By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,168 Members | 680 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,168 IT Pros & Developers. It's quick & easy.

Access 2003 Form - Query Builder Criteria Parent Form Reference

P: 1
Hello Experts,

I have two systems written in Access 2003 that I'm in the process of merging. A user will be given a specific screen depending on his user name. I have a form (let's call it frmPMain) that I'd like to use as a stand-alone filter but I'd also like it to be a subform of another form (frmWMain).

My question is this - In SQL Query Builder is there a way that I can reference a field's parent form without an implicit reference to the exact form that the field is on?

Example:
I would like to replace Forms!frmPMain!txtSupplier and Forms!frmWMain!frmPMain!txtSupplier with something like Parent!txtSupplier in the criteria section of the query then requery the subform.

Any help would be appreciated!
Thanks
Sep 20 '07 #1
Share this Question
Share on Google+
1 Reply

hyperpau
Expert 100+
P: 184
Yes. I can't use your form names but allow me to give you an example.

Let's say your Main form is name frmMain. then the subform of this is name subfrmMain. on the main form, there is a field named txtSupplier. the subform also has a field name txtSupplierFromMainForm.

if you want to reference the subform's txtSupplierFromMainForm field to the main form's txtSupplier field, you normally would do this as:
Forms!frmMain!txtSupplier

an alternative to this is:
Me.Parent!txtSupplier

remember to you period (.) in Me.Parent instead of exclamation mark (!)

Good luck!

Hello Experts,

I have two systems written in Access 2003 that I'm in the process of merging. A user will be given a specific screen depending on his user name. I have a form (let's call it frmPMain) that I'd like to use as a stand-alone filter but I'd also like it to be a subform of another form (frmWMain).

My question is this - In SQL Query Builder is there a way that I can reference a field's parent form without an implicit reference to the exact form that the field is on?

Example:
I would like to replace Forms!frmPMain!txtSupplier and Forms!frmWMain!frmPMain!txtSupplier with something like Parent!txtSupplier in the criteria section of the query then requery the subform.

Any help would be appreciated!
Thanks
Sep 21 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.