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.
DateStampExample.accdb
kbay808Asked:
Who is Participating?
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
0
Kelvin SparksCommented:
Sorry, didn't see you database attached. I don't usually download and open these.
0
kbay808Author Commented:
Does that go into a macro or do I put that somewhere in the properties?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy 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.

Kelvin
0

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

0
kbay808Author Commented:
I figured out using an update query.
0
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.
0
Gustav BrockCIOCommented:
> I figured out using an update query.

That is not how to do. Listen to Kelvin.

/gustav
0
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.

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.