Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking enterred dates 1

Status
Not open for further replies.

sblanche

Technical User
Jun 19, 2002
95
0
0
US
I have 2 tables. One my main (one) and the other a date table (many). On my data entry form I have a date tab. The date tab/table has"

In Date
Out Date
Date Item

My users are making data entry mistakes by enterring an out date (5/5/05) that comes before the in date (4/4/05). Is there a way to program the "Out Date" field in the form to check the "In Date" field to make sure the enterred date is "greater" > then the "In Date". If so, which "event" would I use (Lost Focus?). I would like them to get prompted that they have made a mistake before they can move away from the field.

thanks for your help.
SLB
 
On the AfterUpdate event of the Out Date textbox (assuming that txtIn and txtOut are the names of your textboxes - change as appropriate).
Code:
If txtOut < txtIn Then
txtOut=""
txtOut.Setfocus
msgBox "Hey, check your dates!"
End If

HTH

John


When Galileo theorized that Aristotle's view of the Universe contained errors, he was labeled a fool.
It wasn't until he proved it that he was called dangerous.
[wink]
 
John:
Works like a charm. Thanks very much!!

SLB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top