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

Report based on current date. 1

Status
Not open for further replies.

monkeysee

Programmer
Sep 24, 2002
201
US
I want to run a transaction report that when opens and filters the transaction date for the current date. I wish to do this with just a 'click of the button' and not have the user to enter the date to run the report. Is there any way to do this using an event procedure? or what could I use? and what would the code be. Thanks in advance for any help!
 
I would use a form with a text box and a command button. The text box default value should be set to =Date() so it displays the current date. Name the text box "txtDate". Then add a command button to open the report. The code might look like:

Code:
Dim strWhere as String
strWhere = "[transaction date] = #" & Me.txtDate & "#"
DoCmd.OpenReport "Your Report Name Here", acViewPreview, , strWhere

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top