Full Version: Enter query criteria from form
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
thegatorfactory
Hi again all.
I have a report (StaffRecord) that is based on a query. The query has two set of criteria necessary to select the correct staff member and date details.The query selects an individuals record [StaffName] and runs between selected dates [Start Date] and [End Date].

I have an unbound form (StaffSelectForm) that displays the names of the staff [StaffName], a [Start Date] and an [End Date]. The user is to select a staff name from the cbo box, then enter a start and end date, click a command button, and have the report run, based on the query with the staff/date details.

What do I put in the query (criteria) that makes the query get the [StaffName], [Start Date] and [End Date] information from the form.
Additionally, if no date is selected, I want all records for that person to be displayed.
Any help appreciated.
Steve M
Larry Larsen
Hi
Have a look at this link that will give some direction about selecting selected records.
How to Return All Records When Parameter Is Blank.
Ps: Your selection of an individual should be based on their ID# not "Name"..
HTH's
thumbup.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.