Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Access - Click Value on Report to Bring up Underlying Data

Posted on 2013-05-20
4
Medium Priority
?
543 Views
Last Modified: 2013-05-20
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
0
Comment
Question by:bezellvi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 39182357
try changing

DoCmd.OpenReport "Project Summary", acViewReport, , "[ePMRef]= '" & [ePMRef] & "'"

with

DoCmd.OpenReport "Project Summary", acViewPreview, , "[ePMRef]= '" & Me.[ePMRef] & "'"


if [ePMRef] is number type of data, use this


DoCmd.OpenReport "Project Summary", acViewPreview, , "[ePMRef]= " & Me.[ePMRef]
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39182469
<No Points wanted, as capricorn1 has already your question.>

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
0
 

Author Comment

by:bezellvi
ID: 39182477
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...
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39182510
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question