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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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)
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
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)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.