Accumulate Data

A Combo box allows changes in the status recorded for each record in a table (A).

I would like to accumulate a historical record of what's been changed, and when. So I want to set up a new table(B), containing 3 fields: an index(to link back to the main table A), the new status, and the date/time when it happened.

What would be the best trigger for an event associated with the Combo box? And what code will enable me to create a new record each time for the table B?

Thanks,

Vaughan
VaughanMAsked:
Who is Participating?
 
nico5038Commented:
The "CurrentDb" is referring to the current database and saves the "trouble" in defining a Workspace and a Database before executing the acyion query.
Just select the word and press F1 to get the context sensitive Help about the use of the CurrentDb.

Nic;o)
0
 
nico5038Commented:
Best to use the BeforeUpdate event of the form.
There you can use:

currentdb.execute ("insert into tblLog (DateTimeUpdate, oldvalue, newvalue) values (Now(),'" & me.status.oldvalue & "','" & me.status & "'")

Getting the idea ?

Nic;o)
0
 
VaughanMAuthor Commented:
Hi Nic,

Best to use the BeforeUpdate event of the form. - OK, got that.

The  currentdb.execute is foreign territory to me - where can I find a good introduction to it? I'm OK with VBA, but I don't know the currentdb word.

Thanks,

Vaughan
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.