Move records from Append Query to Simple Query

S

Stockwell43

Hello,

I was wondering how I can place a button on my form that when clicked, will
transfer records from my append query to a simple query so I can export to
excel?

I tried to export the append query but it gave me an error but when I try
the same procedure with my simple queries it works fine.

Any help would be most appreciated!!!


Thanks!!
 
K

Ken Sheridan

I'd suggest you open your append query in design view, change it to a simple
SELECT query and then using File | Save As, save it under a different name.
You can then use this query to export to Excel, and the original append query
for inserting rows into a table.

Ken Sheridan
Stafford, England
 
S

Stockwell43

Hi Ken, thanks for responding.

For some reason my data is not getting pulled in as before. What I am trying
to do is this:

I want to import a table from one database into this new one with a click of
a button. I created a query using this code I found on the internet:

INSERT INTO tbldocprepinfo
SELECT *
FROM tbldocprepinfo IN 'H:\Test Folder\B2B Export\Centralized Doc
Preparation.mdb';

Seems to work as it will import the records from the remote table to my
local table. It creates an Append query so I was not able to export to excel.
But now that I did a save as, it doesn't import the remote table anymore when
I click the button and when I export, the database only exports the headers
on the columns.

I am at a loss thinking this would be easier than it is. Do you have any
suggestions??

Thank you Ken!!
 
S

Stockwell43

I'm sorry. You idea worked great and I and ALL SET!! I accidentally deleted
the records from the remote database but when I copied another and replaced,
it works fine. I apologize for being dense, I should pay a bit more
attention. :blush:)

Thanks Ken!!!!
 
S

Stockwell43

Ken, May I ask one more qurstion please?

In the code below, I have an * to select the entire table. However, say I
only need field1, field2, field5, field8, field11 and field15 how would I put
this in the select part of the query so only those fields will import from
the remote table to the local table?

Thanks!!!
 

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