One method is to use a VBA function to return the value based on which
form is open. In the simplest example that I can think of, that might
consist of a function that looks something like:
Public Function vGetValue()
If CurrentProject.AllForms("YourFormName").IsLoaded Then
vGetValue=Forms![YourFormName]![YourControlName]
ElseIf CurrentProject.AllForms("SomeOtherFormName").IsLoaded Then
vGetValue=Forms![SomeOtherFormName]![SomeControlName]
else
vGetValue=Null
End If
End Function
In your query you would use
vGetValue()
instead of the reference to the form control.
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
If the form for my criteria is closed how do I write the criteria to look for
the same field name in another form that is open? I placed the 1st option in
the Criteria box and the 2nd option in the box marked "or"(under the criteria
label).
Hope some one can help.
Thanks from Down Under