• OpenFile Dialog Box (2000)

    Author
    Topic
    #375274

    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

    Viewing 2 reply threads
    Author
    Replies
    • #610065

      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

      • #610376

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

      • #617658

        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?

        • #617681

          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

          • #617695

            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.

    • #610131

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

    • #610363

      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 = “C:DataTestFile.txt”

    Viewing 2 reply threads
    Reply To: OpenFile Dialog Box (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: