Dates and automatic date updates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I place a date field in my form that is automatically updated when
something one of my data fields is updated?
 
Assuming MyControl is the data field and MyDate is the date, I assume you
want to post the current date and time:

Put this code on the After Update event of MyControl:

Me.MyDate=Now()
 
Put this code on the After Update event of MyControl:

Use the *form's* AfterUpdate event procedure. And you will need to add the field
to your table, first, if you haven't already.

If you want only the date, use:

Me.DateField.Value = Date()

If you want both date and time, use (as suggested by smk23):

Me.DateField.Value = Now()
 
I'm trying to do something similar. I tried these solutions but they didn't
work for me. I have 2 dates on the form and I would like one to
automatically offset by 90 days from the first. The fields are "ApplyDate"
and "ExpireDate".
I tried placing the following in the "On Update" event of "ApplyDate"
me.txtExpireDate=me.ApplyDate+90. The applyDate field is a date picker and
the Expire field is a txt field.

Thanks for any help.
Phil
 
Back
Top