form used for query parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that is being used to fill in query parameters. There are
several text boxes on the form & I would like the person to be able to just
fill in whatever fields he/she wants (might be any 1 or 2 or more of the 10
fields) and then run the query.

Is there a way to do this?
 
Yes. You will need to set the criteria of your query something like:

.... WHERE
( (Field1 = Forms!frmCriteria!TextBox1) OR (Forms!frmCriteria!TextBox1 Is
Null) ) AND
( (Field2 = Forms!frmCriteria!TextBox2) OR (Forms!frmCriteria!TextBox2 Is
Null) ) AND
( (Field3= Forms!frmCriteria!TextBox3) OR (Forms!frmCriteria!TextBox3 Is
Null) ) AND
.....

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top