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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2002: Letting The User Pick The Date? 1

Status
Not open for further replies.

TheElephantMan

Programmer
Jun 18, 2004
42
US
Hello, all.

I have a database table where each record has an entry for a date. I would like to create a query (and then a report) that outputs this information in a variety of ways, but allows the user to enter the specific date to search for, by hand.

I've worked with Access quite a bit, but I cannot figure out how to create this functionality.

A little help would be most appreciated.

Regards,
TEM
 
TEM
There are several ways to do this...

1. In your Date column in the query that populates your report, put criteria [Enter Date to check].

2. Create a form with an unbound text box. Call it txtSelectDate. Put a command button which will open the report, in either Preview or Print form depending on your preference. In the Date column in the query, put criteria Form!frmYourFormName!txtSelectDate. Then when you click the command button whatever date you have entered in txtSelectDate will use that as the criteria in the query that populates the report.

3. A modification of #2. Created a form with an unbound text box called txtSelectDate. Put a command button which will open the report. The code line which opens the report will be something like...
Code:
DoCmd.OpenReport, "YourReportName", AcPreview,,"[YourDateName] = Form!YourFormName!txtSelectDate"

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top