report and form record selectors

dulija

New member
Local time
Today, 15:29
Joined
Feb 17, 2008
Messages
9
In short, I have a form base on query and on that form have command button. When I push button I get report generate from mentioned query. I want report show just data which record selector point on (it would be just one record).I have read about filtering data, but find nothing about create condition based on event Does anyone have some suggestion to solve this problem?
 
Look at the wherecondition argument of OpenReport.
 
You would open your report by using this:

DoCmd.OpenReport "YourReportNameHere", acViewPreview,,"[YourIDField]=" & Me!YourIDFieldName

The YourIDField is the field in the recordset of the report you are going to open and YourIDFieldName is the name of the ID field for the currently selected record.
 
reporting based on form

what if I want to do this, but a little more complex? I have a report that shows each person and all their quality scores under them. I want to have a form call the report with only the person selected, and the quality scores between a date range (instead of ALL the scores).
 
"[YourIDField]=" & Me!YourIDFieldName & " AND DateField Between #" & Me.StartDate & "# And #" & Me.EndDate & "#"
 
THANKS! this works great in access, but I have my users running access runtime. Know of a way to let me display the reports without an error that closes the whole program?
 
What error do you get? That code should work fine with the runtime version; virtually all my users are on runtime versions. Using runtime, you have to be more vigilant at using error trapping, as you've seen the result of not having it.
 

Users who are viewing this thread

Back
Top Bottom