简体   繁体   中英

Save new record to different table with button macro

I have an Access database and one of my tables is connected a form. I want to delete a record from my table and add it to another table with just one button. Deleting it is simple but I can't find a way to add the record to another table. Do you have any opinion on that?

1 Create 2 queries
An insert query
A delete query

2 Create a macro that has three actions

  • Open query( To run an append query)
  • Open query(To run a delete query)
  • A msg box, that will pop up to state that the two queries above ran successfully

N:B The insert and delete query will have parameters like record id

 Attached is sample of insert query with parameter
  • The insert query in the macro condition should come first

宏观 插入查询设计视图 插入查询SQL视图

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM