Hi,
I have an afterupdate event on a date field that will make the next date field the last day of the month based on the first date field:
afterupdate code
Now, I want to have a default value for the first date field, of the first of this month. I use the following code:
However, now the afterupdate event doesn't work. I guess because the first date field is never updated, it is just a default value.
Anyway to get what I want to work?
I want the first date field to default to be the first day of this month, when they tab over to the next field, I want it to default to the last day of the month in the first field.
Any clues??
Thanks very much for any help!
I have an afterupdate event on a date field that will make the next date field the last day of the month based on the first date field:
afterupdate code
Code:
Private Sub TxtStart_AfterUpdate()
Me![TxtEnd] = DateSerial(Year(Me![TxtStart]), 1 + Month(Me![TxtStart]), 0)
End Sub
Now, I want to have a default value for the first date field, of the first of this month. I use the following code:
Code:
DateAdd("d",-(Day(Date())-1),Date())
However, now the afterupdate event doesn't work. I guess because the first date field is never updated, it is just a default value.
Anyway to get what I want to work?
I want the first date field to default to be the first day of this month, when they tab over to the next field, I want it to default to the last day of the month in the first field.
Any clues??
Thanks very much for any help!