One Query for two forms

basilyos

Registered User.
Local time
Today, 07:51
Joined
Jan 13, 2014
Messages
256
hello


i have 2 forms and on update query based on user id
so i want to run the same query if form1 is open or form2


i put on criteria


[forms]![form1]![uid] or [forms]![form2]![uid]


but when run query form1 a dialog appear ask me for [forms]![form2]![uid]


and when run query form2 a dialog appear ask me for [forms]![form1]![uid]


mhy solutio is to make two seperated query but could i solve this problem with just one query
 
You don't say how you run the query.?
 
command on click from the opened form
 
Methinks your only other option besides 2 separate parametized queries would be to build the query sql with vba (code). By referring to form controls in the query, you've eliminated the possibility of having one query. Even if both forms were open and one hidden because the user shouldn't see it, it still wouldn't work because the invisible form controls would be empty.

Even then, as code you would require 2 procedures, one for each form, even if they were only one-liners that called the same public sub. Probably easier for you to have separate queries.
 

Users who are viewing this thread

Back
Top Bottom