Link to home
Start Free TrialLog in
Avatar of VaughanM
VaughanMFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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
Avatar of nico5038
nico5038
Flag of Netherlands image

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)
Avatar of VaughanM

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of nico5038
nico5038
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial