How can I make the date field change automatically when I make a .

N

Ngina 28

How can I make the date field change that I set up automatically change when
I make changing in my other fields... etc. If I change a persons name in the
name field, I want my date field to reflect and change when I made the
change.
 
L

Lynn Trapp

Put the following code in the BeforeUpdate event of your data entry form.

Me.txtYourDateField = Date()
 
T

Tony

Lynn -

I have a field called lastUpdated and it is a manual field that we change
whenever we get a new email/phone/address/add a course, etc in a training
table.

What coding do I use for that field? I tried it on the berfore and also on
the after update field and still didn't have any luck.

I do this on the form...for the field lastUpdated...and put that event in
there, right?

Thanks!!!
Tony
 
R

Rick B

Putting the code in the Before Update will cause it to update when you make
a change to the record, but not if you simply view the record.


Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.LastUpdate = Date()
End Sub




Rick B
 
T

Tony

I haven't done any coding in Access before. Where do I insert that code?
And what does "Me" standfor in Me.LastUpdate?

We have a responder table that holds most of the info and we wanted this
lastUpdated to change when we touch any of the others...will that be the case?

Thanks Rick!
Tony
 
R

Rick B

You need to open the form in design-view. Go into the form's properties box
and find the "update" event. double-click in that field or select "event
procedure" from the drop down, then click the elipse to the right (...).
Update the code window as outlined in my earlier post.

Hope that helps.

Rick B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top