rudodoo
asked on
Access 2000 File Browser Code Does not Work in Access 2003
I program a script to display a window for the user to browse to a file to import. It only works in Access 2000, but not in Access 2003. CommonDialog.MSComDlg.Comm onDialog.1 Error is Object does not support property or method.
Private Sub btn_Browse_Click()
On Error GoTo ErrorHandler
ComDialog.CancelError = True
ComDialog.DialogTitle = "Select File Name"
ComDialog.Filter = "XLS Files (*.XLS)|*.xls"
ComDialog.DefaultExt = "csv"
ComDialog.ShowOpen
Form_frm_ImportFile.FileNa me.Value = ComDialog.FileName
Exit_btn_Browse_Click:
Exit Sub
ErrorHandler:
If Err.Number = 32755 Then Exit Sub
MsgBox Err.Description, vbOKOnly
Resume Exit_btn_Browse_Click
End Sub
Private Sub btn_Browse_Click()
On Error GoTo ErrorHandler
ComDialog.CancelError = True
ComDialog.DialogTitle = "Select File Name"
ComDialog.Filter = "XLS Files (*.XLS)|*.xls"
ComDialog.DefaultExt = "csv"
ComDialog.ShowOpen
Form_frm_ImportFile.FileNa
Exit_btn_Browse_Click:
Exit Sub
ErrorHandler:
If Err.Number = 32755 Then Exit Sub
MsgBox Err.Description, vbOKOnly
Resume Exit_btn_Browse_Click
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I will leave the following recommendation for this question in the Cleanup topic area:
Split: LPurvis {http:#16316870} & thenelson {http:#16319870}
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
jjafferr
EE Cleanup Volunteer