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 / September 2007

Tip: Looking for answers? Try searching our database.

validate a field on form open. IP2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob C. - 17 Sep 2007 17:02 GMT
I create forms in vb.net pulling info from Outlook.  The IP form has a drop
down list of states, but if a value from outlook is not in the list the user
gets on indication of the problem.  What type of xpath statement can I use to
see if a value exists in a list?
Bob C. - 17 Sep 2007 17:08 GMT
To clarify, the list is a secondary ds list of states.  The field being
validated is in a repeating address list, where state is one of the elements
of an address.

> I create forms in vb.net pulling info from Outlook.  The IP form has a drop
> down list of states, but if a value from outlook is not in the list the user
> gets on indication of the problem.  What type of xpath statement can I use to
> see if a value exists in a list?
S.Y.M. Wong-A-Ton - 18 Sep 2007 07:16 GMT
While you've provided additional info, it is still difficult for someone to
tell you what kind of XPath expression you'll need. But here are some
pointers: You could use a filter on the secondary ds looking for the selected
value and then count the amount of nodes that result from that. If the
count() is zero, the item does not exist in the list. I did something similar
in this article:
http://enterprise-solutions.swits.net/infopath2007/display-message-box-when-item
-does-not-exist-in-combo-box.htm


Alternatively, if you're writing code, you could retrieve the secondary ds
using the DataSources object, loop through all the rows in the ds and check
whether the selected value exists.
---
S.Y.M. Wong-A-Ton

> To clarify, the list is a secondary ds list of states.  The field being
> validated is in a repeating address list, where state is one of the elements
[quoted text clipped - 4 lines]
> > gets on indication of the problem.  What type of xpath statement can I use to
> > see if a value exists in a list?
Bob C. - 18 Sep 2007 16:12 GMT
Thanks SYM,

I was hoping for a Count type of xpath statement.  In psudo-code it'd look
like this:

count the number of  entries in the state_validation_list that match the
value of the field.

I'll pursue your recommendations.

> While you've provided additional info, it is still difficult for someone to
> tell you what kind of XPath expression you'll need. But here are some
[quoted text clipped - 18 lines]
> > > gets on indication of the problem.  What type of xpath statement can I use to
> > > see if a value exists in a list?
 
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.