A family of Microsoft relational database management systems designed for ease of use.
Thank you this is wonderful!
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
A family of Microsoft relational database management systems designed for ease of use.
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.
Thank you this is wonderful!
strFile1 = "D:\Documents\Family Tree Maker\Wright-Jagoe(1) Media" & Me.DigitFileName1
strFile1 = "D:\Documents\Family Tree Maker\Wright-Jagoe(1) Media" & Me.DigitFileName2
If DIR(strFile1) = "" OR DIR(strFile2) = "" Then
I have photos and images in two different folders. Is it possible to add code so that the search will include both folders?
thanks Walt
Scott, thanks, I will add this code, and for all your help. Walt
My instructions were to use either
Application.FollowHyperlink Me.txtFilename
or
Application.FollowHyperlink "C:\photos" & Me.txtFilename
Apparently your field DigitalFilename contains just the filename and not the path. So you used the right method, but the wrong controlname. Once that was corrected it worked.
What you might want to do is error trap this. Something like:
Private Sub OpenImageBtn_DblClick(Cancel As Integer)
Dim strFile as String
strFile = "D:\Documents\Family Tree Maker\Wright-Jagoe(1) Media" & Me.DigitFileName
If DIR(strFile) = "" Then
MsgBox "File does not exist!"
Else
Application.FollowHyperlink strFile
End If
End Sub
This way if you have a file name that doesn't have a corresponding file in the foilder, you will get an explanatory message.