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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accepting valid dates

Status
Not open for further replies.

rajivghare

Programmer
Mar 12, 2003
8
IN
Dear friends,

i am new to vfp.

How to accept only a valid date, in a date text box

and how to display it on the form so that the user knows that he has to feed date.

In fp 2.x i use to write

for e.g

@1,1 say "Date"get mdate pict "99-99-9999" defa ctod(" - - ")
read

kindly help.


rajiv.
 
rajivghare

Try setting the format of the textbox to DE. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 

Dear friend mgagnon

Thanks for reply

Please tell me some more on it.

thanks
rajiv
 
set value of textbox to {} to start with

then in gotfocus event of textbox put this line of code...

ON READERROR Messagebox("The date should be entered in mm-dd-yyyy format.",16,"Invalid Date")

...then in the lostfocus of the textbox put...

ON READERROR

...this is what i do for textbox date validation anyways Slighthaze = NULL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top