Changing the value of a text box in the text box changed event

E

Eric

Hi,
I have text box that must validate it's data from a web service when it is
changed. If the data is invalid the value must be removed from the text box.
This would not seem like a hard thing to do but for some reason I cannot get
it to function correctly.

Private inChangeEvent As Boolean = False
Public Sub testTextBox_Changed(ByVal sender As Object, ByVal e As
XmlEventArgs)
' Write your code here to change the main data source.
If inChangeEvent Then
Exit Sub
End If
'validation test here...
'if validation fails:
inChangeEvent = True
e.Site.SetValue("")
inChangeEvent = False
End Sub

I am using Infopath 2007.

Thanks for the assistance,

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top