Date field and calendar

hansnyc

Registered User.
Local time
Today, 14:00
Joined
Apr 12, 2007
Messages
50
I have a "Shipping Deadline" txt field on a form called frmQuotations.
the record source of the form is tblQuotations
the control source of the txt box is ShipDeadline which is a date field on tblQuotations

Right now the user types the date in. But by mistake someone could enter 05/30/2006.

How can I restrict that field to only date that are otday and onforward in time? meaning no past date

Is it also possible to have a calendar popup to choose from?
 
In the forms after update event

Private Sub Form_AfterUpdate()
If Me.Yourdatefield<= Date Then

MsgBox "Date field should contain future date value - please check", vbCritical + vbOKOnly + vbDefaultButton1, "Error"
End If
End Sub
 
It should be >=Date() and in the BeforeUpdate event
 

Users who are viewing this thread

Back
Top Bottom