Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2006

Tip: Looking for answers? Try searching our database.

Allowing The User To Select Query Criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kieron White - 01 Apr 2006 21:12 GMT
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
Bill - 01 Apr 2006 22:14 GMT
Yes, this is very simple to set up in a form. I have something similar
working that allows the user to select among four or five different
combination boxes to limit the list. I use a command button for the user
to indicate the selections are complete and apply the filter criteria to
the list. It does get a bit complicated in the background, but it is
simple for the user.

> 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
[quoted text clipped - 8 lines]
>
> Kieron White

-----------------------------------------------------------
> Posted using QuadSucker/News, http://www.quadsucker.com
> ... the ultimate tool for newsgroup downloading!
-----------------------------------------------------------
Ken Sheridan - 02 Apr 2006 18:58 GMT
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

> 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
[quoted text clipped - 8 lines]
>
> Kieron White
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.