Access 2000 File Browser Code Does not Work in Access 2003

Posted on 2006-03-28
Last Modified: 2011-10-03
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"
    Form_frm_ImportFile.FileName.Value = ComDialog.FileName
    Exit Sub
    If Err.Number = 32755 Then Exit Sub
    MsgBox Err.Description, vbOKOnly
    Resume Exit_btn_Browse_Click
End Sub

Question by:rudodoo
    LVL 44

    Accepted Solution

    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 )
    LVL 39

    Assisted Solution

    Try using the API instead:

    Or use the FileDialog property:
    Dim dlgOpen As FileDialog

    Set dlgOpen = Application.FileDialog( _

    With dlgOpen
        .AllowMultiSelect = True
    End With
    LVL 27

    Expert Comment

    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.

    EE Cleanup Volunteer

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now