Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Aug 2002
    Location
    Michigan, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OpenFile Dialog Box (2000)

    I know in MS Word you can use the DIalogs(wdDialogFileOpen) command to launch the File...Open feature. Is there something similar you can do in Access too? Thanks, Steve

  2. #2
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OpenFile Dialog Box (2000)

    Steve,
    Here is an example of open dialog box in Access97
    Copy the API and the code on the form to suit your needs
    Scott
    Attached Files Attached Files

  3. #3
    Star Lounger
    Join Date
    Aug 2002
    Location
    Michigan, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OpenFile Dialog Box (2000)

    Scott, thank you very much for your reply. This looks like just what I need. I appreciate your time...!!!

  4. #4
    Star Lounger
    Join Date
    Aug 2002
    Location
    Michigan, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OpenFile Dialog Box (2000)

    Hey Scott (or anyone else), one quick question for you please. How do I return the variable path to the file that the user selected...? E.g., filepicked = "CataTestFile.txt"

  5. #5
    Star Lounger
    Join Date
    Aug 2002
    Location
    Michigan, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OpenFile Dialog Box (2000)

    OK, never mind - got it. Use this variable to return the file selected: filepicked (the variable) = cdlg.Getname.

  6. #6
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: OpenFile Dialog Box (2000)

    I pulled a copy of the attachment and it seems to do what I want, except that i want to put the form code into a module procedure, but it dies on the line:

    lngFormName = Me.hwnd

    As I am not using a form.

    I admit I don't understand the coding (hence my question)

    Could you modify the form code for me so that it will run from a module please?
    "Heading for the deep end"

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: OpenFile Dialog Box (2000)

    You can't use the keyword Me in a standard module, only in a class module, which includes the code behind a form or report. If you aren't using a form, you can use the hWnd of the Access application itself like this:

    AccessHWnd = hWndAccessApp
    Charlotte

  8. #8
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: OpenFile Dialog Box (2000)

    Thankyou Charlotte!
    I have muddled through and got the coding in the right place. I have been after this sort of thing for a while.
    "Heading for the deep end"

Posting Permissions

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