Rather than wait for a response, I spent time closely reviewing the screen shots and with some trial and error, successfully modified the code to read:
Function LaunchCD(strform As Form, Optional InitialFolder As String = "C:\") As String Dim OpenFile As OPENFILENAME Dim lReturn As Long Dim sFilter As String OpenFile.lStructSize = Len(OpenFile) OpenFile.hwndOwner = strform.hwnd sFilter = "All Files (*.*)" & Chr(0) & "*.*" & Chr(0) & _ "JPEG Files (*.JPG)" & Chr(0) & "*.JPG" & Chr(0) OpenFile.lpstrFilter = sFilter OpenFile.nFilterIndex = 1 OpenFile.lpstrFile = String(257, 0) OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1 OpenFile.lpstrFileTitle = OpenFile.lpstrFile OpenFile.nMaxFileTitle = OpenFile.nMaxFile OpenFile.lpstrInitialDir = InitialFolder OpenFile.lpstrTitle = "Select a file using the Common Dialog DLL" OpenFile.flags = 0 lReturn = GetOpenFileName(OpenFile) If lReturn = 0 Then MsgBox "A file was not selected!", vbInformation, _ "Select a file using the Common Dialog DLL" Else LaunchCD = rim(Left(OpenFile.lpstrFile, InStr(1, OpenFile.lpstrFile, vbNullChar) - 1)) End If End Function
Reply from Richard Rost:
Glad you figured it out, Robert. I do my best to help people out here in the Forums, but I can't promise a personal reply to each post. Some weeks are just much busier than others.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Imaging Seminar.