Move record Macro

NaveenNandigam

Registered User.
Local time
Today, 14:16
Joined
Mar 31, 2005
Messages
14
Can any one help me in creating a Macro in which whole record is moved from one table to another table
:confused:
 
There's no "move" query. However, there is an "append" query, which can be followed by a "delete" query.
I've got to really wonder about your table structure if you have two tables with the exact same fields.
If records have a different meaning determined by what table they're in, make a field to represent this meaning and put them all in one table.
 
Record move Macro

Thank You,
My tables are setup in such a way that record should be moved from current table to History table once an action is completed.
So can you help me how to incorporate this one.
 
OK, rather than me walk you through building an append query step by step, use the help in access. Type in "Append" and select "Create an append query". I assume you will be working from a form, in which case you don't need the delete query.
When you design the append query, go to the Criteria block under the primary key field and right click and select Build. Find your form and double click on the primary key field to add it to the workspace. Click OK.
This way, when you run the query from your form, it will only append the current record. (Your destination table should have a number primary key, but not autonumber.)
I don't use "macros", but I assume from your post that you do. Make one that will run the query and then delete the current record from the form.
I would use code behind a button something like this:
DoCmd.OpenQuery "MyAppendQuery"
DoCmd.RunCommand acCmdDeleteRecord
 

Users who are viewing this thread

Back
Top Bottom