Select Query using a Value in one or 2 combo boxes

spectrolab

Registered User.
Local time
Today, 11:13
Joined
Feb 9, 2005
Messages
119
Hi,

I currently have a select query that has a where statement to select a value depending on the value of a combo box in a form.

Code:
WHERE (((tblSampleSubmission.SubmissionNumber)=[Forms]![frmReportPreview]![SubNumber]))

What I am wondering is there any way that the where statement can be for another form depending on what form is currently active by using an "or" statement?

Basically what I am trying to do is make the db as easy to use as possible and not have to type in the value again.
 
sure you can:

WHERE (((tblSampleSubmission.SubmissionNumber)=[Forms]![frmReportPreview]![SubNumber] or tblSampleSubmission.SubmissionNumber)=[Forms]![frmNameOf2ndForm]![FieldName]))

Dave
 
Thanks for the reply Dave,

I tried what you suggested, but it still asks for the first value even if the form isn't active and the combo box is empty.

Would it just be easier to write a new query?
 

Users who are viewing this thread

Back
Top Bottom