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

App hangs on incorrect date entry 2

Status
Not open for further replies.

derren

Programmer
Mar 22, 2001
500
GB
Hi

I have a textbox with a controlsource of a date field of a table. The format is set to 'D' (and it has been tried without this as well)

The problem is that if you enter an invalid date then in the fox environment you get "invalid date, press space" but when the app is run on a client's machine the error is not displayed and it appears to just hang, so they would not know to press the space then escape key. No problem - fire a check in the valid event and revert the value to {} if it isn't a good date.

Can I get any event to fire before the field value is checked by the table - can I hell! I have done valid, lostfocus and error, but none of them are called first. Does anyone know where I can put my validation to capture incorrect dates? Or do I have to put validation rules on the table itself? Derren
[Mediocre talent - spread really thin]
 
set value 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
 
Superb! What can I say - have a great big star from me, especially for the concise answer!

Thanks a lot! Derren
[Mediocre talent - spread really thin]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top