Hi I am using Infopath2007 and VB(real rookie - but finally making headway(I hope)).
I have a Data Connection to a webservice. Users can enter DisplayNamePart (3chars or more), and the Webservice brings back the desired information. All this is working well.
BUT
If the user enters "smi" for example there are too many records returned and an error message is displayed
If the user enters "xyz" there are no records and an error is displayed.
Neither error is at all helpful to a user.
I would like to trap these errors and help the users to put the query right. - I understand what I have got to trap is a System.Net.WebException:
How do I do this in VB ?
So far my code reads....
Dim Datconcol As DataConnectionCollection = Me.DataConnections
Dim datcon As DataConnection = Datconcol.Item("UserInfo")
datcon.Execute()
I have thought about looking in the Secondary DataSource to see if there are values in the fields - but this gives me another exception which I don't know how to trap.
Thank you for your help
Catharine