Allowing The User To Select Query Criteria

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

Guest

I would like to know whether or not it is possible to create a query which is
displayed as a series of combo boxes or list boxes where the user can select
which options they would like to choose.

I would like to have the option for the user to choose about 5 different
sets of criteria before the query is activated.

Is this a possibility?

Many Thanks In Advance

Kieron White
 
Kieron:

To make the criteria optional, i.e. the user can select values from none to
five of them you need to test for each having a value or being Null. Firstly
you need an unbound dialogue form with the 5 combo boxes and a button which
opens the query, or better still a form or report based on the query. Then
in the query you reference each combo box as a parameter like so:

SELECT *
FROM MyTable
WHERE
(Field1 = Forms!MyForm!FirstCombo OR Forms!MyForm!FirstCombo IS NULL)
AND
(Field2 = Forms!MyForm!SecondCombo OR Forms!MyForm!SecondCombo IS NULL)
AND
(Field3 = Forms!MyForm!ThirdCombo OR Forms!MyForm!ThirdCombo IS NULL)
AND
(Field4 = Forms!MyForm!FourthCombo OR Forms!MyForm!FourthCombo IS NULL)
AND
(Field5 = Forms!MyForm!FifthCombo OR Forms!MyForm!FifthCombo IS NULL);

Ken Sheridan
Stafford, England
 

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