ErrorProvider

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • artteam
    New Member
    • Feb 2007
    • 18

    ErrorProvider

    Hi All,
    I have used errorProvider to validate the text in the textboxes. One among them is that it does not allow the user to enter empty string.But when I click the close button on the form it does not close instead the errorProvider pops up validating for the text(As the textbox is left blank).Is there a property to disbale or to make it inactive?

    Thank You in advance.
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    If you use the warningProvider , you may want to clear it by setting it to "", after checking whether the control is valid. Here is an article that may help:
    ErrorProvider as a 'Warning Provider'

    Comment

    • artteam
      New Member
      • Feb 2007
      • 18

      #3
      Hi,

      But I do not have to check for the validation when the user is trying to close the form without entering any text into any of the textfields. And this happening with respect to only one textform. And the close button is not bothered with other textboxes on the form. If i enter some value in that textbox then the form closes.

      Please help me out!!!

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        You are having a problem with errorProvider trying to validate the empty textbox and not allowing the form to be closed... Therefore you need a way to clear it before closing, hence the suggestion. Do you have other textboxes that do not allow empty strings?

        Comment

        • artteam
          New Member
          • Feb 2007
          • 18

          #5
          Yes you are right.We cleared the errorProvider before closing the form.Thank you very much for your suggestion.

          Comment

          • knychtell
            New Member
            • Jan 2007
            • 66

            #6
            have you tried this one?:
            if txtbox1.text="" then
            errorprovider1. seterror("txtbo x1, "The txtbox should not be left blanck!")

            else ' to set the error off
            errorprovider1. seterror(txtbox 1,"")
            end if

            Comment

            Working...