export query

S

steve c

Thanks in advance for your time.

I am using a query to select records of flights which
have elapsed in a Flight Tracking Database. Flights each
have a "flight time," which can be FRI AM, SAT AM, SAT
PM, SUN AM, SUN PM. I am trying to export records which
correspond to a flight time so that I may delete them
from the database and still retain a record of them. For
instance, once Friday night is over, we want to dump
records that are linked to "FRI PM" to a spreadsheet and
delete them. To export them, I figured the best idea was
to start with a select query which selected all "FRI PM"
records. From here I do not know where to go. I'm sure
I could set up a simple delete query to remove the
records once they've been safely exported, but I am
having trouble figuring out how to export to excel based
on a select query. Thanks in advance for
help/suggestions, or even just for reading this far :D.
 
J

John Nurick

Hi Steve,

If you're working from the user interface, just select the query in the
Databse window and then do File|Export.

In VBA, the standard way of exporting to a spreadsheet is
DoCmd.TransferSpreadsheet.

But it's seldom necessary to delete past records from a database (at
least not this urgently). Ordinary they can be left there for the
historical record; just use date criteria on your queries so that users
only see the current records.
 
D

Darren R. Barnes

You could also use a macro to do this with a double-
click. Do a new macro, use the Text Delimited option, the
Table Name will be the name of the query you want to
export, the File Name will be the path and 'name'.CSV.
It's easy and it will work great for what you want. I
agree with the last post, you can keep the old records for
historical data.
-----Original Message-----
Hi Steve,

If you're working from the user interface, just select the query in the
Databse window and then do File|Export.

In VBA, the standard way of exporting to a spreadsheet is
DoCmd.TransferSpreadsheet.

But it's seldom necessary to delete past records from a database (at
least not this urgently). Ordinary they can be left there for the
historical record; just use date criteria on your queries so that users
only see the current records.



Thanks in advance for your time.

I am using a query to select records of flights which
have elapsed in a Flight Tracking Database. Flights each
have a "flight time," which can be FRI AM, SAT AM, SAT
PM, SUN AM, SUN PM. I am trying to export records which
correspond to a flight time so that I may delete them
from the database and still retain a record of them. For
instance, once Friday night is over, we want to dump
records that are linked to "FRI PM" to a spreadsheet and
delete them. To export them, I figured the best idea was
to start with a select query which selected all "FRI PM"
records. From here I do not know where to go. I'm sure
I could set up a simple delete query to remove the
records once they've been safely exported, but I am
having trouble figuring out how to export to excel based
on a select query. Thanks in advance for
help/suggestions, or even just for reading this far :D.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top