Hi
I am having difficultly launching a file, in my case an MS Access file when selected using the Common Dialog Box object using source code below. Do I need to add additional source code to 'shell' the access application? Code samples are ideal for understanding how dialog is used to filter and select files.
In anticipation, many thanks.
I am having difficultly launching a file, in my case an MS Access file when selected using the Common Dialog Box object using source code below. Do I need to add additional source code to 'shell' the access application? Code samples are ideal for understanding how dialog is used to filter and select files.
In anticipation, many thanks.
Code:
Private Sub cmdopenDatabase_Click()
With comDlg
comDlg.DialogTitle = "Open database File"
comDlg.Filter = "Microsoft Access Files (*.mdb)|*.mdb"
comDlg.FilterIndex = 1
comDlg.Flags = cdlOFNFileMustExist + cdlOFNHideReadOnly
comDlg.CancelError = True
End With
' Enables error handling to catch cancel error
On Error Resume Next
' display the dialog box
comDlg.ShowOpen
If Err Then
MsgBox "Dialog Cancelled"
Exit Sub
End If
MsgBox "You selected the following Access Database File: " & comDlg.FileName
End Sub