HI all,
Need to populate fields using VB (code behind).
field1:
ID bound to a datasource called datas1
field2:
ID bound to datasource2 called datas2
field3:
Yr bound to datasource2 called datas2
The field2(same as field1) and 3 are populated once field1 has been found on
XXX table.
I know I can use rules and actions based on value changed of field1 to
populate field2 but I also have some other tables that are queried based on
the values of fields2 and field3. Basically, I am creating schedules for
students using the student's ID and School year.
How can I read the values of field1 from vb.net and how can I set the values
for field2 and field3?
I can read some of the values using the follwing:
Dim root, user2 As System.Xml.XPath.XPathNavigator
root = Me.MainDataSource.CreateNavigator
user2 =
root.SelectSingleNode("/dfs:myFields/dfs:queryFields/tns:GetProfile/tns:Studentid", Me.NamespaceManager)
'user =
root.SelectSingleNode("/dfs:myFields/dfs:queryFields/tns:Getsyears/tns:studentid", Me.NamespaceManager)
MessageBox.Show(user2.ToString)
I think my problem is in how to read the nodes(query fields) using different
datasources.
S.Y.M. Wong-A-Ton - 06 Feb 2007 09:32 GMT
Take a look at
http://enterprise-solutions.swits.net/infopath2007/article.php?t=infopath-2007-f
requently-asked-questions-faq&c=infopath2007
You use data sources the same way as the MainDataSource and can retrieve
datas1 with
DataSources("datas1")
---
S.Y.M. Wong-A-Ton
> HI all,
> Need to populate fields using VB (code behind).
[quoted text clipped - 30 lines]
> I think my problem is in how to read the nodes(query fields) using different
> datasources.