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

Filtering my Report on Current Record 1

Status
Not open for further replies.

iXPhound

Technical User
Feb 25, 2001
146
US
Hi All:

I have a quick question. I have a form (frmTime) that pops up with a users time information. I also have a report (rptTime). I want to put a button on frmtime that calls the report and filters on the current record. Is there any way to do this? TIA!!!!

 
Hi there, create a button on the form and when you are going through the wizard to create the button chose the option to run the report. Then go into the OnClick event for the button and add a where statement to the Docmd.runreport arguement... If you put a comma after the end of the statement, you will see what part of the argument you are on. When you get to the Where part put (in quotes)

"[Your ID field]= [Forms]![frmTime]![Your ID Field]"

Hope I have that syntax right :)

Dawn
 
When Opening Report using Docmd.OpenReport
The last parameter is where condition
So give the where condition such that the report
opens and filters out your current record

Docmd.OpenReport "rptName",,,"Where Condn"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top