InfoPath starting point (repeating controls to submit form)

D

Dataplex

I'm sorry if I appear to be trolling but I've been searching for a while and
can't seem to find the answer to my question. I am working on a web
application project that involves a couple of departments within the company.
My department is responsible for coding the web application while another
department is responsible for supplying the data for the application.

I have created an XML Schema for use in the SQL 2k5 database to store the
records for this system. However, we do not have an interface for the other
department to directly upload data into the database. My solution was to use
Infopath to give them an easy to use form to submit data via XML files or
email (or possibly a web service).

I do not know that much about InfoPath and have had a hard time finding a
good starting point to learn all of its features. What I want to do is have
a single form based on the XML Schema I've created in VS.NET 2k5 that has a
submit button that will send the data to me, and then clear the form for
another entry to be put in. Each time I create the form by supplying the
Design Form wizard with the Schema, it creates all of the fields in repeating
sections with controls and does not allow me to change them to regular
controls. Furthermore, if I try to change the overall form design to a
single layout with buttons, it erases all of the controls on the form and
will not allow me to add just a single control...it forces me to use
repeating controls.

Any help or resources would be very much appreciated! TIA!
 
S

S.Y.M. Wong-A-Ton

A good starting point to learn more about InfoPath is:
http://msdn.microsoft.com/office/program/infopath/2003/learn/

As to the issue you're having: If you've bound your form to a database
table, you will be required to use repeating controls for the simple reason
that a db table row needs to be represented by a repeating node in the XML of
the form and that when you submit data back to the db table, all repeating
nodes (=rows) are submitted back.

If you do not want to use repeating controls then you'll have to code the
submission of the data back to the database yourself. While the following
sample does not use managed code you could modify it to suit your needs:
http://enterprise-solutions.swits.net/infopath/programmatically-add-db-record-vbscript.htm
 
D

Dataplex

S.Y.M. Wong-A-Ton said:
A good starting point to learn more about InfoPath is:
http://msdn.microsoft.com/office/program/infopath/2003/learn/

As to the issue you're having: If you've bound your form to a database
table, you will be required to use repeating controls for the simple reason
that a db table row needs to be represented by a repeating node in the XML of
the form and that when you submit data back to the db table, all repeating
nodes (=rows) are submitted back.

If you do not want to use repeating controls then you'll have to code the
submission of the data back to the database yourself. While the following
sample does not use managed code you could modify it to suit your needs:
http://enterprise-solutions.swits.net/infopath/programmatically-add-db-record-vbscript.htm

I guess I'm not opposed to using the repeating controls - but is there a way
to only show one record of the repeating information? Basically there will be
multiple people working on this form concurrently and I don't want them to
have to deal with a huge scrolling list of records. I only want them to see a
new blank form, fill it out, hit submit, and be presented with errors if
there are any, or a new blank form if submission was successful.
 
S

S.Y.M. Wong-A-Ton

As I said previously, you'll have to code this functionality yourself. Did
you take a look at the references I provided?

You can add non-repeating fields to your form by adding them directly
through the Data Source pane (and not by dragging and dropping them onto the
form, since InfoPath will then try to bind them for you). Once you have added
these fields, you can drag-and-drop them onto the form from the Data Source
Pane, write code to retrieve their values, generate an XML node for a row
using these values, append this row to the repeating group representing your
db table, and then submit the form. After submission, you can clear all
fields in code.

As a side note: You are not required to put repeating controls on your form.
However, the structure of your form will always contain repeating nodes.
 

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