Displaying the "File" box in access

JustinCooper
JustinCooper used Ask the Experts™
on
Hello.

This is a quick and easy one for someone (I hope!)

I'm allowing the user to export some data from access via a button on a form. All I want to do when the button is clicked is display the "Save As" file box that all Microsoft products display. The the user can select the path and filename and see if a filename exists etc.

In excel I write this..

'   display the open file dialogue box
    filt = "All files (*.*),*.*" & _
           "Excel files (*.xls),*.xls," & _
           "Text Files (*.txt),*.txt," & _
           "Comma Separated files (*.csv),*.csv,"
    filterindex = 5
    Title = "Select output file"
    fullfile = Application.GetOpenFilename(filefilter:=filt, _
        filterindex:=filterindex, Title:=Title)

which displays the box for the user.

How do i do this in access? is it the same? Do I have to reference anything?

Cheers

Justin

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ryan ChongSoftware Team Lead

Commented:
What i always do is use the API to open the common dialog boxes, why? It's bcos we no need to include the M$ Common Dialog Control in our application.

Take a look at http://www.freevbcode.com/ShowCode.Asp?ID=631
All common dialogs plus some extra dialogs

Cheers

Author

Commented:
Is there an easyier way than this??

This seems very complex compared to a single line of code in excel.

Software Team Lead
Commented:
You can try use the M$ Common Dialog Control.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered: ryancys
Please leave comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

nexus

*** if only VBA amongst programs were the same. I have had 3 lines in access that took a good three pages in Excel. Welcome to Microsoft... =)

Author

Commented:
Ta.

sorry about the slow response, I've been away

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial