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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a Query and Exporting 1

Status
Not open for further replies.

dwarvenmilitia

Programmer
Apr 18, 2006
45
NZ
Hi... I have very limited VB knowledge just to state.

I'm trying to export data from a table (entered via a form) to a new db with only some of the fields. In the form I have a button that is to run the event.

I managed to copy the DB with DoCmd.TransferDatabase but have no idea how to code from there.

ssatech suggested to this...

"What about running an append query for only those fields you want into a new table/temp table and than exporting that table. You could do it all (Run the query and export)from your command button."

This is precisely what I'm trying to do but have no idea where to start...

Would anyone be able to help please??? :)

Cheers
 
Why not just link to the table in the 2nd database and use the append query to add records to that table. Something like.....

INSERT INTO tblDatabaseTwoTable(FieldNames)
SELECT FieldNames
FROM tblDatabaseOneTable

etc



Randy
 
if it is a one time thing, you could also make a query with the selected fields. Copy paste the result of the query into a new table (datasheet view) of a new database.


Pampers [afro]
Just let it go...
 
hey guys...

cheers for that. I found insert into worked like a charm to create a temp table with filtered fields and then export that and then delete that update table from original db.

I actually found the answer after many hours of constant trial and error whilst trying to get syntax correct! :p

Cheers a lot. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top