Open Photographs in an Access Form

Anonymous
2023-01-26T23:26:10+00:00

I have a datatbase of photograph file names. In the DB I have a List Form that has a "Digital File Name" field. Question: Is it possable to create a command button on my List Form that will open the photo (that is stored in my Photos File on my C: drive) based on the digital file name for the selected record?

I am using Access 2016

Thanks Walt

Microsoft 365 and Office | Access | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

49 answers

Sort by: Oldest
  1. ScottGem 68,840 Reputation points Volunteer Moderator
    2023-04-21T21:36:10+00:00

    You have the FollowHyperlink twice. Once before the IF, once inside the IF. You on ly want the one inside the IF.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-04-21T22:23:44+00:00

    I deleted the second FollowHyperlink which solved the image opening twice but the message box still didn't come up.

    I used:

    Private Sub OpenImageBtn_Click()

    Application.FollowHyperlink Me.DigitalFileName

    If Dir(Me.DigitalFileName) = "" Then

    MsgBox "File doesn't exist"

    End If

    End Sub

    Was this answer helpful?

    0 comments No comments
  3. ScottGem 68,840 Reputation points Volunteer Moderator
    2023-04-22T00:54:53+00:00

    You deleted the wrong one.

    I said; "You only want the one inside the IF."

    If the image opens then the If condition is False so the message wouldn't display. The message would only display if the filename doesnt exist.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-04-22T15:44:13+00:00

    Scott,

    Thank you so very much everything is working. Its been a struggle, but I have enjoyed learning from you. You are a great teacher.

    Walt

    Was this answer helpful?

    0 comments No comments