After much research I got the thing working.
And, yes, you can update data inside a form.
My solution was to create a xpath expression on the ITEM column on the repeating
table I mentioned in my first email.
In the Text Box properties of the ITEM node, in the formula area,
This is what the formula looks like when it is added by infopath
count(preceding-siblings::*/.)+1
I entered it this way:
count(preceding-siblings::*/Item_Count)+1
Where ITEM_COUNT is my name for the ITEM column. infopath changes that to a DOT
(.) in the formula when its entered.
Now when I call up the form, the ITEM starts with 1, then as you add a line, the
item goes to 2, and so on. One thing you MUST do to get it to work when you
insert a line or delete a line in the list is to Click the box marked "Update
this value when the result of the formula is recalculated.
If you don't then it will not work when you insert or delete a line. The
inserted line will have the wrong number. And the deleted line will not change
the other lines correctly.
As for inserting data into the form from SharePoint, this works great also.
I have a drop down box, that gets its data from the SharePoint list.
For example:
I create a drop down box called: Departments.
In SharePoint I create a list with one line and change Title to Departments.
Then I simply add all the department names to the list.
Next I go to my form Drop Down Department and edit the "Drop Down List
Properties" box to point it to the SharePoint list called Departments under
"List Box Properties". Select the "Look up values from an external data source"
and follow the directions from there.
Once connected, when you open the form, click on the Department drop down arrow,
and the same list you created in SharePoint is pulled in.