Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate exporting an Access table to DB5

Status
Not open for further replies.

Walloe50

Programmer
Mar 28, 2005
2
US
I have a number of Access tables that are created monthly. These tables are then manually exported to DB5 to be taken in by a SAS program.
Is there a way I can automate exporting these Access tables to the DBF (DB5)?
Thanks
 
Try

DoCmd.TransferDatabase acExport, "dBase 5.0", "Drive:Folder\", acTable, "AccessTableName", "DBaseFileName", False

Hope this helps.
 
Thanks Earthandfire, but I forgot to mention that VB is a foreign language to me. Would this be the only code I would need to perform this function?

AML
 
Goto modules, create a new module and add some code as below to the module

Code:
Sub export_tables()

  DoCmd.TransferDatabase acExport, "dBase 5.0", "Drive:Folder\", acTable, "AccessTableName", "DBaseFileName", False
  DoCmd.TransferDatabase acExport, "dBase 5.0", "Drive:Folder\", acTable, "AccessTableName", "DBaseFileName", False
  DoCmd.TransferDatabase acExport, "dBase 5.0", "Drive:Folder\", acTable, "AccessTableName", "DBaseFileName", False
  DoCmd.TransferDatabase acExport, "dBase 5.0", "Drive:Folder\", acTable, "AccessTableName", "DBaseFileName", False

End Sub

repeat the docmd line as many times as required and remember to change the File Path, and table names for each export.

Then all you have to do each month is run the code and the tables will be exported.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top