How do run a query and export it to a table all in the same macro

  • Thread starter Thread starter Guest
  • Start date Start date
You need to clarify what you are trying to do. You can create a table by
simply running an existing make table query from a macro (OpenQuery).

If you REALLY want to export the data to a table (in another Access
database?), you need to tell us that.

Bob Galway
 
Currently i Import a excel file where i peform some calcs that cannot be done
in access. Once done i Import from that spreadsheet, run 1 querey to create
some specific identifers, and the second query based off the first which
matches the identifiers and outputs the clasifications of each asset. I then
want to export this to excel.

Im trying to make this easy for others who will be using the process. They
just want to be able to cut and paste into excel. Run a macro in access and
have it output to a different sheet where they can retrieve it.
 
Almost all Excel functions have an equivalent in Access ..so you may be
underselling it ..it may be easiest to use them in a query. For fun, try
muliplying fields, for example test:[field1]*[field2] will give you the
result in a query field called test

That having been said, most users prefer to work in Excel. To export to
Excel, simply use the OutputTo action in a macro.

Bob Galway
 
Although the OutputTo action can export to Excel, in most cases
TransferSpreadsheet would be preferable.
 
Thanks guys.

Since im learning on the fly, i have just discoverd how to query the
database from excel and therefore do not need to export it.

Thanks for you help.
 
Back
Top