Insert in repeating table is inserting new row in every repeating

L

LaurieAPMarsh

I have an InfoPath form connected to a database. There are several tables
into which the form feeds data. Each table has a common key so they are all
in the main connection. There is a drop-down list at the top of the form for
the user to select the appropriate key. When this is done, all the tables on
the form are populated with the corresponding data in the database.

If none of the tables have any data and I insert a new row in one of them, a
new row is automatically added to every table. This causes the user to have
to go delete the rows in the other table before submitting the form due to
required fields in those tables.

How can I stop InfoPath from inserting a new row in every table? Keep in
mind this only occurs when none of the tables have any data to begin with.
 
A

Adam Harding

Laurie

I believe the datasource(database) is forcing the form to do this as all the
repeating tables are linked on the same key in the master.

By repeating one table you are creating in the database identical entries
for the master key forcing the other tables to do the same to match up. For
example,

Master.ID is repeated for Table1 meaning that Master.ID is repeated for
tables two and three.


What you need is to have a different table for each repeating table of which
ALL link back to the same master key in the master table. Then each one can
repeat as many times as it likes, independantly of the others. For example,

Master.ID links to Table1.Number on a one to many relationship
Master.ID links to Table2.Number on a one to many relationship
Master.ID links to Table3.Number on a one to many relationship

Hence each time you insert a row for table1 NO ROWS GET ADDED for the other
tables. The same will apply for the others.

Hope this helps

Cheers Adam
 
L

LaurieAPMarsh

Adam,
The database already has separate tables. As an example, there is a Table A
of Employees each of which has a key. Table B is a list of attributes with a
link to the Employee key. Table C is a list of other attributes again with a
link to the Employee key.

My form includes a repeating table for Table B and another repeating table
for Table C. There is a drop-down query list for the selection of the
employee key. When an entry is selected in the drop-down list, the query is
executed and the Table B and Table C are updated with the corresponding
attributes for that employee.

In addition, the InfoPath repeating tables for Table B and Table C have a
filter applied so only the "active" attributes are displayed.

What is strange is that if there is one item in either table already,
inserting a new row doesn't effect the other table. It only happens when
there is nothing in both repeating tables.

Any suggestions?
 
A

Adam Harding

I have just tried to replicate

Table1 has three fields 1, 2 and ID
Table 2 has 4 fields, 3,4,ID and Numbers which links on a one-to-many basis
in the database and in infopath
table 3 has 4 fields, 5,6,Id and Numbers which links on a one-to-many basis
in the database and in infopath

I then linked them in infopath on a one-to-many relationship such that when
i set up the tables in the data connection they all had the little blue arrow
in the bottom left corner of their icon indicating this. try this yourself
and then go into preview to show how independant they are.

I cannot replicate your problem.

If you go into DataSource and click the drop-down arrow next to the 2nd or
3rd table and see if it gives you the option to insert a repeating table, if
it does then they will repeat independantly.

can you print-screen the datasource view of your form and i will probably
see what is wrong fairly quickly. Mail it to (e-mail address removed)
you will have to ZIP it up first to get it through our firewall.

Cheers Adam
 

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