Question : Pass the current form name to a function within a module

Hi

I am trying to send the current form name to a function when the OnCurrent event occurs. I am currently using the following code which is producing an error:

On Current
=LoadArray([Me])

and in my vba module...

Function LoadArray(FormName As Form)
    Set CurrentForm = FormName
etc
End Function

The error I am getting is "The object doesn't contain the automation object 'Me.'"

Where am I going wrong? Thanks in advance

Matt

Answer : Pass the current form name to a function within a module

in the On Current event of the form remove  =LoadArray(Me)
select Event Procedure from the drop down
then click on the (...)
place this in the VBA window

Private Sub Form_Current()
Call LoadArray(Me)
End Sub



Random Solutions  
 
programming4us programming4us