Undo Button

  • Thread starter chris0309 via AccessMonster.com
  • Start date
C

chris0309 via AccessMonster.com

Hi All,

Im using the DoCmd.TransferText to upload a new file to a table. However im
trying to create an undo command therefore when the user updates the database
they can click the undo button to remove the updated rows. Is it possible?

Thanks for any help.

Chris
 
M

Maurice

That can be done but you must have some sort of indocator which rows were
added at that specific time. I tend to use a temp table in these situations
and place the imported data in there. Then I ask the user if he wants to
proceed and then use an update query to update the records, if not I just
delete the records in the table.
 
C

chris0309 via AccessMonster.com

I can transfer the new data into a temp table however how do i transfer the
data from the temp table to the main table?

Chris
That can be done but you must have some sort of indocator which rows were
added at that specific time. I tend to use a temp table in these situations
and place the imported data in there. Then I ask the user if he wants to
proceed and then use an update query to update the records, if not I just
delete the records in the table.
[quoted text clipped - 5 lines]
 
M

Maurice

Make sure the temptable has the same fields as the main table. Create a query
an put a join into the key field. Set the updatefields to the maintable and
save the query. Also creat a delete query from the temptable and save this
one as well.

When you run your code and the user wants to update the table run the
updatequery, when the user wants to undo run de deletequery which clears the
temptable.

you can run the queries with the docmd.openquery option from vba
--
Maurice Ausum


chris0309 via AccessMonster.com said:
I can transfer the new data into a temp table however how do i transfer the
data from the temp table to the main table?

Chris
That can be done but you must have some sort of indocator which rows were
added at that specific time. I tend to use a temp table in these situations
and place the imported data in there. Then I ask the user if he wants to
proceed and then use an update query to update the records, if not I just
delete the records in the table.
[quoted text clipped - 5 lines]
 

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