Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update date field if one of several other fields is changed

Status
Not open for further replies.

emzadi

IS-IT--Management
Feb 13, 2001
69
US
What is the best way to update a date field to the current date/time if one of several other fields is changed?

Thanks. Susan M. Wagner
LAPELS
susanw@lapels.com
 
on the after update event of the fields, set the date field to the value of the function now

me.datebox = now() Mike Rohde
rohdem@marshallengines.com
 
Ok, that's the way I did it, but I was wondering if there was a way to just make one function, not one for each field...

Thanks anyways! :) Susan M. Wagner
LAPELS
susanw@lapels.com
 
How about the after update event of the form? Mike Rohde
rohdem@marshallengines.com
 
Seems like I tried that before, but it wasn't successful... I will try again...

Thanks! Susan M. Wagner
LAPELS
susanw@lapels.com
 
How exactly would one accomplish that? An If statement? Susan M. Wagner
LAPELS
susanw@lapels.com
 
If you want to update the field if any control on the form is changed, you could assign the value on the before or after update:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.datebox = now
End Sub

If you just want to update the time after certain controls are updated, I believe you are going to have to use the after update event of each control. Mike Rohde
rohdem@marshallengines.com
 
Ok... that's what I'll do then... thanks so much for your patience! :) Susan M. Wagner
LAPELS
susanw@lapels.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top