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: Newest
  1. ScottGem 68,840 Reputation points Volunteer Moderator
    2023-02-27T16:11:22+00:00

    You had 2 different paths assigned to strFile. But then you referred to strFile1 and strFile2 in your I statement.

    In your last post, you are overwriting strFile1 in the second line. So its never checking the first one. Same with strFile2.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-02-27T15:55:44+00:00

    I'm not sure I understand. The varibles are the different paths so I think I need to repeat the code with the different path as below.

    strFile1 = "D:\Documents\Family Tree Maker\Wright-Jagoe Media" & Me.DigitalFileName1

    strFile1 = "D:\Documents\Family Tree Maker\Wright-Jagoe Media" & Me.DigitalFileName2

    strFile2 = "D:\Documents\Family Tree Maker\Laidlaw-Fowler Media" & Me.DigitalFileName1

    strFile2 = "D:\Documents\Family Tree Maker\Laidlaw-Fowler Media" & Me.DigitalFileName2

    if DIR(StrFile1) = "" OR DIR(strFile2) = Then

    Is this it?

    Was this answer helpful?

    0 comments No comments
  3. ScottGem 68,840 Reputation points Volunteer Moderator
    2023-02-27T12:38:51+00:00

    No, because you assigning two different values to the same variable. You need to create two separate strFile variables.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-02-26T23:39:54+00:00

    Question: Would this be correct?

    strFile = "D:\Doucumets\Family Tree Maker\Wright-Jagoe Media" & Me.DigitalFileName1

    strFile = "D:\Doucumets\Family Tree Maker\Laidlaw-Fowler Media" & Me.DigitalFileName2

    If DIR(strFile1) = "" OR DIR(strFile2) = "" Then

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2023-02-26T23:33:35+00:00

    Thank you this is wonderful!

    Was this answer helpful?

    0 comments No comments