Q:

opening a file VBA from path data in query

I have a query in my MS ACCESS database that yields:
event (in this case, a goanna has been photographed)
photo name (e.g., IMG_0002.JPG)
path to file (e.g., c:\documents\random_place)
In the form I have built, I added a button, and built this event:
Private Sub Command17_Click()

    Application.FollowHyperlink "C:\Documents\random_place\IMG_0002.JPG"

End Sub

No problem.
But what I really want is to populate the path to the file with information returned by the query (as opposed to having typed it in manually), since button I have there is static, and now all the events show photo IMG_0002.JPG, where in fact different records have different file names and even paths.
I guess I am looking for something like:
Application.FollowHyperlink paste{result from path},{result from filename}
if you see what I mean...

A:

Assuming the query you mention is the form's RecordSource, code can reference fields/controls to build the file path\name in the button click event. 
FollowHyperlink Me![path to file] & "\" & Me![photo name]

