Date fields automatically updating when field matches todays date!?! Help!

  • Thread starter Thread starter Brian Cassin
  • Start date Start date
B

Brian Cassin

I have a date field in one of my forms, and when todays date matches, I
would like it to automatically increase the month part of the date by one,
can anyone help with how I go about this ?
Also if it could take into consideration the changin of the year as well,
even better!
Many thanks.
 
I have a date field in one of my forms, and when todays date matches, I
would like it to automatically increase the month part of the date by one,
can anyone help with how I go about this ?
Also if it could take into consideration the changin of the year as well,
even better!
Many thanks.

Well, more precisely, you have a date field in a Table, being
temporarily displayed on a Form.

What do you want to happen? When you navigate to a particular record
in your table using the form, do you want to update the date in that
record to a month hence? The suitable event would be the Form's
Current event and you could use code like

Private Sub Form_Current()
If Me!txtDatefield = Date() Then
Me!txtDateField = DateAdd("m", 1, Date())
End If
End Sub

The DateAdd function will work just as well in December as in any
other month...
 
Back
Top