I have the following code that updates the end date to be the same as the start date after the user tabs out of the start date. Instead of making it the same date, I want it to be six days later. How do I add that?
For example, user enters 11/10/13 in the start date. I want the end date to automatically update to 11/16/2013.
TIA!!
For example, user enters 11/10/13 in the start date. I want the end date to automatically update to 11/16/2013.
TIA!!
Code:
Private Sub StartDate_AfterUpdate()
Dim datDate As Date
If Nz(Me!StartDate.Value, #1/1/1900#) = #1/1/1900# Then
'The user removed the START data as criterion, so remove the END date.
Me!EndDate.Value = Null
GoTo Exit_Now
End If
datDate = Nz(Me!StartDate.Value, #1/1/1900#)
If IsDate(datDate) = True Then
Me!EndDate.Value = datDate
Else
MsgBox "Your start date is not a valid date. Try again."
Me!StartDate.SetFocus
End If
Exit_Now:
Exit Sub
End Sub