We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Access 2000 File Browser Code Does not Work in Access 2003

rudodoo
rudodoo asked
on
Medium Priority
406 Views
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"
    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

Comment
Watch Question

Database Developer
CERTIFIED EXPERT
Commented:
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 )

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Commented:
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
            

Commented:
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
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.