Hi
I've used the instructions from
http://enterprise-solutions.swits.net/infopath/sequential-db-table-record-naviga
tion.htm
to add Back and Forward buttons to my form, and they appear to work
properly. You can cycle through the records, and they update onscreen.
However, if you try to read one of the fields from code*, InfoPath
thinks that it's still on the first record.
I've done a little investigation, and it appears that the full
recordset is being loaded, and that the Back and Forward buttons are
only operating at the visual level. The code underneath is still
looking at the first record, presumably because I haven't told it to
move to the next one. How do I get my code to look at the same record
that the user is seeing?
Thanks
Chris
*For example:
PhotoID =
XDocument.DOM.selectSingleNode("//dfs:dataFields/d:tblPHOTO_CATALOG/@PHO_photo_id").text
Chris - 23 Mar 2006 04:31 GMT
OK, I figured it out:
PhotoID =
XDocument.DOM.selectSingleNode("//dfs:dataFields/d:tblPHOTO_CATALOG[position()
= x]/@PHO_photo_id").text
You substitute the record number for x in [position() = x] so that it
knows which record to look at :)
Chris