How to insert the current date into a field when another field is updated in MS Access?

In the attached example, I have a field called “VerifiedBy” with a dropdown list of users.  When a user updates that field I need the date when it was updated automatic entered into the “DateVerified” field.
Who is Participating?

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

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.

Kelvin SparksCommented:
Use the Before Update event to run

Me.MyFieldName = Date()

Replace Date() with Now() if you need the time component.

Kelvin SparksCommented:
Sorry, didn't see you database attached. I don't usually download and open these.
kbay808Author Commented:
Does that go into a macro or do I put that somewhere in the properties?
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Kelvin SparksCommented:
Open the form in design, then click properties. There will be a series of tabs for the properties window - choose Events and find the Before Update Event. From the drop down choose Event Procedure and click the three dots to open the event window.

Type my code in there, replacing MyFieldName  with the actual control name of the field on the form that you want this to go into.

If you don't know its name click on that control while the form is in design and open the properties. The control name is on the Other tab in the Name field.


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
kbay808Author Commented:
This is what I have, but it's not doing anything.  What I don't see is how it's triggered?  When I update the "VerifiedBy" field, it needs to trigger todays date in the “DateVerified" field.

Option Compare Database

Private Sub DateVerified_BeforeUpdate(Cancel As Integer)
Me.DateVerified = Now()
End Sub

Open in new window

kbay808Author Commented:
I figured out using an update query.
Kelvin SparksCommented:
You have it in the before update of the control.

Me.DateVerified = Now()

Needed to be in the Before_Update of the form itself.
Gustav BrockCIOCommented:
> I figured out using an update query.

That is not how to do. Listen to Kelvin.

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.