Update date control

air4jmh

New member
Local time
Today, 13:23
Joined
Feb 6, 2013
Messages
3
Ok, I've looked around at several threads and didn't get an answer to my question.

I have a form with a date control and would like it to auto update with the current date when the save button is clicked.

I currently have the following code but it is not changing the record.

Private Sub Save_Changes_Click()
On Error GoTo Err_Save_Changes_Click
Me.[Last Update Date].Value = Date

I can give more info in needed.
 
your_control.Value = Date
Me.Refresh

It is much easier if you don't use spaces i control names. Use underscore for instance.
 
Thanks Dylan but that didn't change anything.
is there a need to delete the table data somehow first? would that help?
 
Your code works when i apply it to the forms On data change event ! You could try other events if you wish for the update to activate on visits to the record , such as the on current event .
Hope this is of use to you
Regards
 
thanks for the reply. We got it figured out. I had replaced the button and didn't move the code to the new button. :rolleyes:
 
Last edited:

Users who are viewing this thread

Back
Top Bottom