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!

Passing parameter from vba code to report based on query

Status
Not open for further replies.

psbsmms

Programmer
Dec 14, 2001
74
I need to pass a perameter of the system current date to a report so the query will be activated. do i have to open a recordset to achomplish this? if i do how do I get the report to refernce the recordset and not the query.
 
You could base the report on a query and in the date field just put Date() in the criteria and it will only pull up records for today's system date. I'm not sure if that's what you are looking for.
 
OR if you may be able to make use of
DoCmd.OpenReport reportname[, view][, filtername][, wherecondition]

and use the optional wherecondition argument to do whatever you want e.g. "[Date]="& date()

This may offer a little more flexibility and allows the report to be used a number of different ways depending on the wherecondition used when opening.

filtername could also be used similarly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top