Referencing a nested subform?

harleyskater

IT Manager
Local time
Today, 01:43
Joined
Oct 29, 2007
Messages
95
I need to reference a nested subform.

I have a main form called jobs with a subform called items, that subform has a nested subform called part_items how do you reference this in VBA?


Me.items_sub.Form.RecordsetClone - references my subform

:) thank you!
 
I saw these 2 references on the other post.

Me.Parent.subfrmPROPOSALSetup.requery
Forms.frmPROPOSALSetup.subfrmPROPOSALSetup.Form.Re fresh

So I can reference my nested subform like this?
Me.parent.items_sub.Form
or
Forms.jobs.items_sub.part_items_sub

My main form is called jobs ----- me.refresh
subform on that form is items_sub ---- me.items_sub.refresh
subform of the items_sub is part_items---- me.parent.items_sub.refresh

that doesn't seem correct? parent would be the main form? should that be child?

 
Yes, parent returns you one form up... while part_items is another subform.
So your syntax is not correct, but I bet if you think about it, you can solve it :)

Edit:
Note that Me references the current form that has the focus. So it only works if code is within a form.
Also it Me is the for with the focus so take that into account.

Any code triggered in a "general module" will have to use the Forms!.... notation.
 

Users who are viewing this thread

Back
Top Bottom