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.CommonDialog.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.FileName.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

rudodooAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Leigh PurvisDatabase DeveloperCommented:
It would msot likely be a problem with the control itself rather than the version of Access.
perhaps in converting the library isn't properly referenced.
Perhaps the control needs to be deleted and re-created.

(Or perhaps you could save yourself some hassles and leave the overhead and woes of the ActiveX control behind and look at http://www.mvps.org/access/api/api0001.htm )
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thenelsonCommented:
Try using the API instead:
http://www.mvps.org/access/api/api0001.htm

Or use the FileDialog property:
Dim dlgOpen As FileDialog

Set dlgOpen = Application.FileDialog( _
    FileDialogType:=msoFileDialogOpen)

With dlgOpen
    .AllowMultiSelect = True
    .Show
End With
            
0
jjafferrCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.