Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    80

    Unanswered: open file dialog

    I'm using Access 2002 and I'm trying to open file dialog in a form, so I could choose a single picture file and get the path to it in to a text field. I have created command button (browse) and I tried to paste code that I found in Access help into it, but it doesn't seem to work.

    Private Sub browse_Click()

    Dim dlgOpen As FileDialog

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

    With dlgOpen
    .AllowMultiSelect = False
    .Show
    End With

    End Sub

    When I push the browse button I get a "Compile error: User-defined type not defined" and "dlgOpen As FileDialog" is highlighted. Can anyone help me out?

  2. #2
    Join Date
    Jun 2003
    Location
    UK
    Posts
    68
    Check your references I'm sure you have to have the Office library selected it should be called "Microsoft Office 10.0 Object Library".

    Paul

  3. #3
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    80
    Thanks man... it's working now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •