M
Mike
We have some code that uses the CommonDialog ocx and has worked fine for
months however it has now stopped working on some of our PC's. On the PC's
that it fails, they have version 6.1.97.82 of comdlg32.ocx and the PC's that
work have version 6.0.88.77. Is the new version of CommonDialog no longer
compatible with MSAccess 2002?
Steps to recreate the problem.
In MSAccess 2002
1 - Create a form
2 - Add the CommonDialog control and name it cdl
3 - Add a command button and name it command1
4 - Add the code below to the form
5 - Save the form and open it
6 - Click the command button to launch the FileDialog
7 - Click Cancel on the FileDialog
8 - Click the command button again and you will get a Type Mismatch error
Private Sub Command1_Click()
Dim o As CommonDialog
On Error GoTo Err_Command1_Click
Set o = Me!cdl.Object
With o
.CancelError = True
.ShowOpen
End With
MsgBox o.FileName
Exit_Command1_Click:
Set o = Nothing
Exit Sub
Err_Command1_Click:
MsgBox Err.Number & ": " & Err.Description
Resume Exit_Command1_Click
End Sub
months however it has now stopped working on some of our PC's. On the PC's
that it fails, they have version 6.1.97.82 of comdlg32.ocx and the PC's that
work have version 6.0.88.77. Is the new version of CommonDialog no longer
compatible with MSAccess 2002?
Steps to recreate the problem.
In MSAccess 2002
1 - Create a form
2 - Add the CommonDialog control and name it cdl
3 - Add a command button and name it command1
4 - Add the code below to the form
5 - Save the form and open it
6 - Click the command button to launch the FileDialog
7 - Click Cancel on the FileDialog
8 - Click the command button again and you will get a Type Mismatch error
Private Sub Command1_Click()
Dim o As CommonDialog
On Error GoTo Err_Command1_Click
Set o = Me!cdl.Object
With o
.CancelError = True
.ShowOpen
End With
MsgBox o.FileName
Exit_Command1_Click:
Set o = Nothing
Exit Sub
Err_Command1_Click:
MsgBox Err.Number & ": " & Err.Description
Resume Exit_Command1_Click
End Sub