bezellvi
asked on
MS Access - Click Value on Report to Bring up Underlying Data
I have an access report that lists fields like ID, Date and Summary. I have used the following code to make the ID clickable to bring up a report on the selected record, but it is bringing up a blank report. Thoughts on how to make this work?
Private Sub ePMRef_Click()
DoCmd.OpenReport "Project Summary", acViewReport, , "[ePMRef]= '" & [ePMRef] & "'"
End Sub
Private Sub ePMRef_Click()
DoCmd.OpenReport "Project Summary", acViewReport, , "[ePMRef]= '" & [ePMRef] & "'"
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks - I got it. One other issue I'm having - a report footer is saying 1 of 10 pages when I go to print, but there are only 8 pages...
This may be another, unrelated issue.
Since capricorn1 has answered you original question correctly, you should accept his post and create a new question for this new issue.
Since capricorn1 has answered you original question correctly, you should accept his post and create a new question for this new issue.
Your clickable ID technique will only work if the report is in "Report View"
Report View will allow for interaction, (and Filtering, ..etc)
...But it does have some potential drawbacks.
1. It may not render graphics (per record) correctly
2. Will not display accurate "Page x of y" numberings
3. It will not run any potential custom code on any Format events
In other words it will not give you a true "Print Preview"
To deal with this you can use a buttons on a form to decide what "view to open the report in:
DoCmd.OpenReport "YourReport", acViewReport
Or
DoCmd.OpenReport "YourReport", acViewPreview
Again, no points wanted, just some extra info..
;-)
JeffCoachman