Update a record of one table and save the history of changes in another.

jvirk

New member
Local time
Today, 11:01
Joined
Jun 10, 2007
Messages
4
Hello!
I am trying to update the current status of an asset, when it was returned or checked out. At the same time, save the changes in a history table to record all the changes in past. I can do individually from different tables and different forms, but I would like to do from one form and one record entry. Is it possible? If so can anybody help?
Thanks
JVirk
 
Use the form's AfterUpdate event, as in:

Sub Form_AfterUpdate()

CurrentDb.Execute "UPDATE HistoryTable SET YourField1 = YourValue1, etc."

...or...

DoCmd.RunSQL "YourUpdateQueryNameHere"

End Sub

The form will always automatically save itself to whatever the form's RecordSource property is. A history table has to be written on the side. I'm using updates in my example for a reason: you have to use an append query to add to a history table (SELECT INTO ...).

I'm not trying to give you a direct answer, but rather point you in the right direction so that you can figure this one out. If your name is Blue, I'm your clue. ;)
 
Thank you guys. Combining the two suggestions I made one easy way to get my job done.
 
Glad to hear it. Thanks for posting back with your success.
 

Users who are viewing this thread

Back
Top Bottom