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

Err 2113: The value you entered isn't valid for this field

Status
Not open for further replies.

sophiet

Technical User
Jan 6, 2003
15
GB
I have a date field on my form that gives the above error message if anything other than a date's entered. I've tried customising the error handler in both after_update of the date field in form_error neither of which seems to work. Can anyone help please? Thanks
 
you can try to test the date specifically...

if isdate(someTbx) then
do whatever...
else
msgbox "awwooggaa, awwooggaa..."
endif

Procrastinate Now!
 
I've already got the code for that but I'm having problems with where to trap the error. If I put it in the after update of the date field then I get the microsoft error message and then my error message. If it's in the on_error of the form it doesn't appear at all. thanks
 
the whole point with that is, you shouldn't have to trap that error, because if the error occurs, you redirect your code to do something else...

i.e.

if NOT isDate(someTbx) then
do not update the record, and clear the textbox
else
...
...

Procrastinate Now!
 
Have you tried to put your code in the BeforeUpdate event procedure of the TextBox, playing with the Cancel parameter and the MsgBox function (with your own message).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PH

Thanks - that's totally fixed it.

Sophie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top