Back and Forward appear to work, but don't

C

Chris

Hi

I've used the instructions from
http://enterprise-solutions.swits.net/infopath/sequential-db-table-record-navigation.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
 
C

Chris

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
 

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