Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change query parameters using a form

Status
Not open for further replies.

meierswa

Technical User
Nov 21, 2002
20
0
0
HK
I am working in Office XP. I have developed a query and a report based on the query.

Any suggestions on how I can build a form that will allow the user to change parameters or criteria of the query using list boxes and input fields. Specifically, I would like to be able to enter the start date and the end date in an input field (not the parameter pop up, i.e Between [start date] and [end date]).

Then I would like to be able to select items from two list boxes. These selections would be the equivalent of adding criteria in the respective "QBE query panels" - I think that terminology is correct.

Any assistance is greatly appreciated.
 
On your form put some unbound text boxes (or combo boxes) with names like [StartDateSelected] (the name of the text box object, not necessarily the label assigned to the text box). Add as many of these as items you want to query by. In the query criteria itself type:

[Forms].[FormName].[StartDateSelected]

for each field you want to be able to query by. If one of these fields may or may not have a value specified on the form then use:

Like [Forms].[FormName].[StartDateSelected] & "*"

Put a button on the form that displays the query.

Note that the query will no longer work if the form is not open.

-Larry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top