VBA syntax for referencing a subform. Please help

SGT68

Registered User.
Local time
Today, 10:58
Joined
May 6, 2014
Messages
76
I've got a tabular form called PEOPLE LIST which is data sourced by a query. Records in this form get updated elsewhere and i had a piece of code embedded in the updating form which went:

[Forms]![PEOPLE LIST].Requery

All went well and life was happy. The changes made were reflected in the PEOPLE LIST

But then i decided to make the PEOPLE LIST a subform of NJPN Menu, and i just can't get the requery to happen, probably cos i got the syntax wrong for referencing a subform: . I don't get any error message, just nothing happens:

This is my code: can someone check it for me please:

[Forms]![NJPN Menu]![PEOPLE LIST].Requery
 
[Forms]![NJPN Menu]![PEOPLE LIST].Requery
Peple list needs to be the name of your subform control, not the subform sourceobject which is the name of the actual form
 
As CJ said, you have to call it this way:

Code:
me.mySubForm.Requery
 
Peple list needs to be the name of your subform control, not the subform sourceobject which is the name of the actual form

Thanks to both of you.

I would tick the thanks button - if i could find it!
 

Users who are viewing this thread

Back
Top Bottom