Link a photo in a report to a record

bellemmar

Registered User.
Local time
Today, 14:19
Joined
Mar 9, 2011
Messages
64
Hello. I have a report that returns name, date of birth & photo. I want to be able to click the photo and have it go straight to the person's form record. Is this possible?
 
It sure is. On the Click event of the Image Control put something like this
Code:
DoCmd.OpenForm "[COLOR=Red]FormName[/COLOR]", , , "[COLOR=Red]PersonID[/COLOR] = " & Me![COLOR=Red]PersonID[/COLOR]
... but as you can already see in my code I am referring to the Person ID, not the name. Each person must have a (numeric) unique ID.
 
That is of course you are running 2007 or 2010. Only these versions support on click events on reports.
 
That is of course you are running 2007 or 2010. Only these versions support on click events on reports.
I was actually thinking this was a Forms question :o

But yes, only in 2007 and 2010 in Report View.
 
Forgive my ignorance, the code part of Access is new to me. So if I click the photo and the form I want to open is called Contact Details and each person has a unique ID (auto number), then what would the code look like?
Thank you!
 
... then what would the code look like?
Please read your thread in full. I wrote -->
It sure is. On the Click event of the Image Control put something like this
Code:
DoCmd.OpenForm "[COLOR=Red]FormName[/COLOR]", , , "[COLOR=Red]PersonID[/COLOR] = " & Me![COLOR=Red]PersonID[/COLOR]
... but as you can already see in my code I am referring to the Person ID, not the name. Each person must have a (numeric) unique ID.
Also, you now mention this is a form but your initial post indicates it's a report. Was this a typo?
 
When I click on the photo in the report, I want the person's details form to open. Like I say, the code writing part is new to me so I really appreciate the help!!

Please read your thread in full. I wrote -->
Also, you now mention this is a form but your initial post indicates it's a report. Was this a typo?
 

Users who are viewing this thread

Back
Top Bottom