Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / February 2008

Tip: Looking for answers? Try searching our database.

onvalidate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
steve - 22 Feb 2008 15:24 GMT
I have a whole bunch of VB code in the OnValidate routine for a field.
This code captures data entry errors and displays messages to the
user.   That's fine, but now i realize the user can still attempt to
save the form anyway if they don't change the value (since the
OnValidate is only triggered when a change is made).   At that point
they would get the standard InfoPath error message which indicate a
field has a validation error, which is sure to confuse the users.

I could copy all the validation code into the Submit button routine,
but that's pretty ugly.  i guess i could create a module with the code
and call it from OnValidate and Submit.  Still seems wrong.

There must be a "normal" way of handling this situation (obviously i
don't do this everyday).  Any suggestions?

thanks
Greg Collins - 22 Feb 2008 20:46 GMT
What I've often done is to have the submit function just check to see if
there are *any* validation errors (using the Errors collection) and if so,
give a generic message to go handle those, and cancel out. If no errors,
then proceed with the submit.

Signature

Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com
Visit InfoPathDev at http://www.infopathdev.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.