Export .dbf with Prompt for save location

fenhow

Registered User.
Local time
Today, 10:34
Joined
Jul 21, 2004
Messages
599
Hi, Can anyone tell me how to export data to a .dbf file but prompting the user for the file name and location of the save. I have this code and it works but it is fixed as to the file name and location.

Thanks.

Fen How

Dim access As access.Application
Set access = CurrentProject.Application
access.DoCmd.OpenQuery "qry_si EXPORT FOR MAP"
access.DoCmd.TransferDatabase acExport, "dBASE IV", "c:\", acTable, "qry_si EXPORT FOR MAP", "MIDDLETON 3D ARCVIEW.DBF"
DoCmd.Close acQuery, "qry_si EXPORT FOR MAP"
 
access.DoCmd.TransferDatabase acExport, "dBASE IV", "c:\", acTable, "qry_si EXPORT FOR MAP", "MIDDLETON 3D ARCVIEW.DBF"

at present your path and file names are hard coded. You need to turn them in to variables and pass the variable to the command line.

You do not state which version of Access you are using, however, you may fine that the common dialog control or FileSystemObject will fulfil your wishes.

David
 

Users who are viewing this thread

Back
Top Bottom