Transfer Text Command

  • Thread starter Thread starter Tom Jepors
  • Start date Start date
T

Tom Jepors

Hi I would like to use the TransferText command in the
OnClick event of my CommandButton to output my whole
database to a csv file and place it on the desktop. Can
anyone help me to do this?? I only have very limited
application programming knowledge.

Thanks

Tom
 
What do you mean by 'whole database'? A database is (in general terms) a
collection of tables that link together. If you are just talking about a
single table (or a query that you can include all the relevant information
in) then it would just be something like this...

Dim path As String
Dim wShell As Object 'New wshShell
Set wShell = CreateObject("WScript.Shell")
path = wShell.SpecialFolders("Desktop")
Set wShell = Nothing
DoCmd.TransferText acExportDelim, , "TableOrQueryName", path +
"\whatever.csv", True
 
Back
Top