Hi
In one of my forms I have a start and end date. The end date has a criteria which is that it shouldn't be an earlier date than the first. I use this piece of code with the "on change" event:
Private Sub ETD_Dato_BeforeUpdate(Cancel As Integer)
If Me![ETD Dato] < Me![ETA Dato] Then
MsgBox "The ETD date is earlier than ETA date, please change ETD date"
Cancel = True
Exit Sub
End If
End Sub
This piece of code worked when I manually wrote in the two dates. But after I have gone over to using calender control for the two dates, the above mentioned code does not seem to do anything.
Appreciate any help
Thanks in advance
Alexi
In one of my forms I have a start and end date. The end date has a criteria which is that it shouldn't be an earlier date than the first. I use this piece of code with the "on change" event:
Private Sub ETD_Dato_BeforeUpdate(Cancel As Integer)
If Me![ETD Dato] < Me![ETA Dato] Then
MsgBox "The ETD date is earlier than ETA date, please change ETD date"
Cancel = True
Exit Sub
End If
End Sub
This piece of code worked when I manually wrote in the two dates. But after I have gone over to using calender control for the two dates, the above mentioned code does not seem to do anything.
Appreciate any help
Thanks in advance
Alexi