View Full Version : Query with two combo boxes, Null?


jwood29
05-14-2008, 10:01 PM
Not sure if this would go in the queries or forms section, but here it is.

I have query that uses parameters from a form. My problem is on the form I have two dropdown combo boxes and they both need to be populated with data otherwise it returns No Data at all.

How do I make it where I can have one value for either one or both values, basically a null statement somewhere in the code.
My form has two combo boxes and two text boxes.

Project_Combo
Employee_Combo
FromDate Txt
ToDate Txt
OK Button
Cancel Button

Example Criteria I have run:
Project A and No Employee equals NO Data.
No Project and Employee A equals No Data.
Project A and Employee A equals Correct Data returned.

Is it possible to get it where I can choose one or both of the criteria when I run the OK button and get returned Data. Or would I have to setup two separate queries and forms, one for Project, and one for Employee.

Thanks in advance all.

jwood29

pbaldy
05-14-2008, 10:16 PM
One way:

http://www.mvps.org/access/queries/qry0001.htm

jwood29
05-15-2008, 07:35 AM
Pbaldy,

Thank You so much. That was exactly what I was looking for. Worked like a charm... You Rock... Have a good One!

~jwood29

pbaldy
05-15-2008, 07:38 AM
No problem; glad it worked for you. Beyond a couple of criteria, I'd probably go a different way, but for 1 or 2 that method works nicely.