EXPORTING FROM ACCESS TO EXCEL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Someone, please help! I have a module that runs a function slf_recloan()
which calls two queries. I need to take one of the queries,
"q_recloans_delete" and change it from a delete query and have it export the
info from tbl_global to excel. Can someone please tell me how to go about
doing this?
 
Someone, please help! I have a module that runs a function slf_recloan()
which calls two queries. I need to take one of the queries,
"q_recloans_delete" and change it from a delete query and have it export the
info from tbl_global to excel. Can someone please tell me how to go about
doing this?

There are two ways to go. Either

1) Make a copy of the Delete query. Open the copy in Design View and
using the commands on the Query menu change it to a Select query, then
edit it so it returns the fields and records you need.

2) replace the statement in your code that executes the Delete query
(e.g.
DoCmd.RunQuery "MyQuery"
or
DB.Execute "MyQuery", dbFailOnError
) with one that exports the Select query, e.g.
DoCmd.TransferSpreadsheet acExport, "MyQuery".....
 
Thank you for your help. I appreciate it.

Nick

John Nurick said:
There are two ways to go. Either

1) Make a copy of the Delete query. Open the copy in Design View and
using the commands on the Query menu change it to a Select query, then
edit it so it returns the fields and records you need.

2) replace the statement in your code that executes the Delete query
(e.g.
DoCmd.RunQuery "MyQuery"
or
DB.Execute "MyQuery", dbFailOnError
) with one that exports the Select query, e.g.
DoCmd.TransferSpreadsheet acExport, "MyQuery".....
 
Back
Top