How to declare an argument to receive a SubForm object (1 Viewer)

cheer

Registered User.
Local time
Today, 19:44
Joined
Oct 30, 2009
Messages
222
Is the below RED color highlighted variable TYPE is correctly declared ?

Public Sub Form_Load
FunctionA subFormName
End

Public Sub FunctionA(ByVal frm as Accesss.Form)
msgbox frm.caption
End
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:44
Joined
Feb 19, 2013
Messages
16,610
No, a number of things

it's Access, not Accesss and isn't actually required - frm AS Form will be just as good

For the purposes of your function as written byVal is OK, but if the function is supposed to modify the form in some way, then it should be byRef

You are also not calling it correctly. It should be
FunctionA subformcontrolname.form
 

Users who are viewing this thread

Top Bottom