Pass form value to query

adams937

Registered User.
Local time
Today, 00:43
Joined
May 16, 2011
Messages
10
Hi,
I'm trying to setup a form where a combo box that is limited to a set of results based on another value in the form. I have the query for the combo box set with the following criteria:

[Forms]![main form name]![subform object name]![field name]

This works great for the current form/subform. However, I am also using the same subform is a different form. When this form is loaded, the query no longer recognizes the [main form name], which has now changed.

Is there a way to make it work in any form? I have tried the following with no success:

[Me]![field name]
[Me]![subform object name]![field name]

Seems pretty simple... but no luck yet. Thanks!
 
If you are using queries I think the best I can suggest is to have specific queries for each form.

However if you convert the query to an SQL statement and run that from within your form you would be able to code that so that it is sensitive to which form is loaded.
 

Users who are viewing this thread

Back
Top Bottom