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

How to print preview by unique date on each page

Status
Not open for further replies.

ukndoit

Vendor
Feb 18, 2007
1
US
I am trying to simplify my life. I need to take the data I have put into my data base, and print on a single day at a time. Almost always that will be todays date only. The date is stored in this format: mm/dd/yy or mm/dd/yyyy only. no time is stored.

How can I make a report only contain that information?
Thank you so much for any assistance you can be.

Richard
 
Create a text box on a form with a default value of Date(). Then use the command button wizard to create a button to open your report. Then modify the code to read something like:
Code:
Dim stDocument as String
Dim strWhere as String
stDocument = "rptYourReportName"
strWhere = "1=1 "
If Not Isnull(Me.txtDate) Then
   strWhere = strWhere & " And [UnnamedDateField]=#" & _
        Me.txtDate & "# "
End If
DoCmd.OpenReport stDocument, acPreview, , strWhere

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top