I am using a form to define parameters

I am using a form to define parameters

Post by QmlsbCBDdW » Thu, 11 May 2006 07:01:01


I am using a form to select parameters. I have fields such as [project Nbr]
and [County]. There may be many projects in a county. I would like to be
able to leave the [Project Nbr] null and have the query return all of the
projects in the county.

I am thinking of using a IIf [Project Nbr] is null and have the query ignore
it or make the selection critera "True". What should I put in the selection
critera of the [Project Nbr] field on the query?

I truly appreciate your help.
 
 
 

I am using a form to define parameters

Post by Douglas J. » Thu, 11 May 2006 07:11:36

You want your WHERE clause to be somethin like:

WHERE ([project Nbr] = Forms!MyForm!MyControl Or Forms!MyForm!MyControl IS
NULL)

You can do this by putting

Forms!MyForm!MyControl Or Forms!MyForm!MyControl IS NULL

as the criteria in the query builder.

--
Doug Steele, Microsoft Access MVP
http://www.yqcomputer.com/
(no private e-mails, please)


"Bill Cunningham" < XXXX@XXXXX.COM > wrote in

 
 
 

I am using a form to define parameters

Post by QmlsbCBDdW » Thu, 11 May 2006 23:59:01

Thanks, Doug. Is Doug ok?

I'll give this a try. As I understand the text as shown below (with proper
names) should be placed in the query critera. Regarding the "or", should
this text be typed in a single critera space or should the parts appear on
two seperate critera spaces?

I'll try both. Thanks again for your help.
 
 
 

I am using a form to define parameters

Post by QmlsbCBDdW » Fri, 12 May 2006 00:40:02

Two lines worked fine.

Thank you