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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update a field to Now() when a button is clicked

Status
Not open for further replies.

JanesC

Technical User
Jan 15, 2002
29
GB
My form has a field for 'date_completed' I'd like it to be updated to Now() when a button is pressed. Thanks
 
All you have to do is simply make a button. Go to onclick into the coding section and and use date_completed = now().
when ever the button is clicked the current date will appear in the date completed field
 
I assume there is a textbox on your form that is bound to a field in the underlying data source. In the Click event of the button:
Code:
    Me.FieldName = Now()
    Me.Refresh

where FieldName is the name of the field you want to update.
 
Thanks jamie13 it works like a dream!
 
Thanks also to MisterC that works as well. You learn something new every day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top