johnkrytus
Registered User.
- Local time
- Today, 04:20
- Joined
- Mar 7, 2013
- Messages
- 91
I want to my ImageFrame to open as a picture. My problem is that my picture could be either a .jpg or a .png (or whatever). The code below works if I hard code profile_pic.png or profile_pic.jpg. Is there a way to use the wildcard here? (Its not working as written now)
Code:
Dim vFolderPath As String, strFile As String, dirFile As String
vFolderPath = DLookup("FolderName", "tblCodes-FolderControl", "FolderKey = '" & "Profile" & "'")
dirFile = Dir(vFolderPath & ctrl_people_id & " *", vbDirectory)
strFile = "\profile_pic." + "*"
If dirFile <> "" Then
Me![ctrl_ImageFrame].Picture = vFolderPath & dirFile & strFile
Else
MsgBox "No directory for this person"
End If