Setting the value of a field in Reapeating Table

M

Mary

Hi. I have created an Infopath form that shows data in a repeating table. The
data is retrieved from the database on Load. Then on submit, it is sent to
the database. My Database is SQL Server 2005. Now i have a field called
userid in my table which i dont want to display to the user. But before
submitting the form, i want to set the value of userid in all the rows of the
repeating table. How do i do so?
 
F

Franck Dauché

Hi Mary,

1. Default Value
Even if the userid is not "visible" on your form, it is in your schema as a
node in your repeating section. What you need to do is to set the default
value of that node following this procedure:
http://www.dotnetjunkies.com/WebLog/dcohendumani/archive/2005/02/17/55147.aspx
For this, you may need to have your actual user id store in your schema
outside your repeating table as a source to your default value.

2. By Code.
Assuming you have your actual user id stored in your schema as described
above, your can set the value of your userid in your repeating table by code,
setting its value in the OnAfterChange Event, each time a row is added in
your table.

Hope that it helps.

Regards,

Franck Dauché
 

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