Using the native DatePicker, that's been available since v2007, is no different than physically entering a date via the keyboard, and so you can do data validation using the Control's BeforeUpdate event.
Replacing DateFieldName with the actual name of your Textbox that holds the date, this will do the job:
Code:
Private Sub DateFieldName_BeforeUpdate(Cancel As Integer)
If Me.DateFieldName > Date Or Me.DateFieldName < DateAdd("d", -15, Date) Then
MsgBox "Invalid Date! Try Again"
Cancel = True
End If
End Sub
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007