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

Form Query Report

Status
Not open for further replies.

Timbo57

IS-IT--Management
Jun 10, 2005
8
US
--------------------------------------------------------------------------------

i have a rental database. i would like to make a form, which would ask the user for a date. After the date is entered have a button which would run a query and then print a report. How can this be accomplished?

Thanks in advance!
Tim
 
Tim
1. Create an unbound form. Let's call it frmReportSelect
2. On the form, create an unbound text box. Let's call it txtDateSelect
3. On the form, create a command button (use the wizard) that runs the report in either Preview or Print mode
4. In the query, in the date column, put the following as criteria
Code:
Forms!frmReportSelect!txtDateSelect

Tom
 
Thanks so much for the help. Can i do something simular to get records for the whole month?

Thanks again in advance!
Tim
 
Tim
There are several ways you can go about this.

Method 1
1. On your form, put two unbound text boxes. Let's call them txtStartDate and txtEndDate
2. In your query, in the Date column, put the following criteria expression...
Code:
Between Forms!frmReportSelect!txtStartDate And Forms!frmReportSelect!txtEndDate

Method 2
1. Put an extra column in your query, created from the expression Month([YourDateColumn])
2. Put criteria in that column
Code:
Forms!frmReportSelect!txtDateSelect
2. In the form, enter the Month, rather than a Date in the unbound text box.

My preference is Method 1, simply because you can select between any two dates.

Tom
 
Thank you very much for the help Tom! it works great!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top