source object into form variable

spinkung

Registered User.
Local time
Today, 08:45
Joined
Dec 4, 2006
Messages
267
Hi

i am dynamically changing the sourceobject of a sub form. I need to pass the subforms sourceobject into a function, as a form.

This doesn't seem to work
Code:
Dim nexTbl As Form
Set nexTbl = Form(frm_nexus_switcher.SourceObject)

I get an 'access can;t find "my form" error. what's going wrong???

thanks,
spin
 
The SourceObject property of the subform control is a string. Instead, use the Form property of the subform control to return a reference to the form object in the control...
Code:
dim frm as access.form
set frm = me.subformcontrol1.form
Cheers,
 
worked perfect thanks.
 

Users who are viewing this thread

Back
Top Bottom