2 Different Database Submit Actions in 1 Form

R

ridawg

Hey,

I would like to create a InfoPath form that would be used to track info
regarding forms (forms we use with our products) that our company uses. Some
of these forms we create and others are created externally. Here's the issue
- for forms created internally I need to generate a unique form number and
the forms created externally already have a number assigned to them.

This was my thought as far as a solution. I would create an Access database
table to store info about each form. Info for both internal and external
forms need to be stored in the same table. Next I would have another table in
my database for internal forms only that would consist of an autonumber. My
thought was in InfoPath when a user goes to enter data about a new form when
they select "Internally" from the Developed By field a button Get Form Number
would become available. They would click this button and a submit would take
place against my second table where I've set up the autonumber. The new
number would be returned to the form number textbox then the user would
submit the completed InfoPath form to my first table.

Hope this makes sense. I'm not sure how to do 2 database submit actions in 1
form. My guess is I will need to write code for one of the submits. I've
never done this so I'm hoping somebody can help me out with an example or
two. I've written a little vbscript before so vbscript examples are preferred.

Thanks!
 
S

S.Y.M. Wong-A-Ton

This is a perfect scenario to use a web service to generate and return the
number, and then submit the (database bound) form to the database. But I'm
afraid you cannot write the web service in VBScript.

Another idea is to use ADO code in your form to retrieve the number. You
would have to write your own code in the OnSubmitRequest of the form.
VBScript can be used for this. You should be able to find code snippets in
this newsgroup and on the Internet for submitting/retrieving data with ADO
and VBScript.

A third idea is to use a classic ASP page to update the db table and
retrieve the number (using ADO again). You would need to have a web server
running somewhere, just like in the first idea. And since you already know
VBScript, you should be able to program in classic ASP.

I do not have code for any of the 3 suggestions above.
 
R

ridawg

Thanks for the ideas. Unfortunately, I don't have a web server available so
classic asp and a web service are out as options. But I'll look around for
examples of ADO and VBScript.

Thanks for the suggestions!
 
S

S.Y.M. Wong-A-Ton

No problem. :)
---
S.Y.M. Wong-A-Ton


ridawg said:
Thanks for the ideas. Unfortunately, I don't have a web server available so
classic asp and a web service are out as options. But I'll look around for
examples of ADO and VBScript.

Thanks for the suggestions!
 

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