Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / May 2005

Tip: Looking for answers? Try searching our database.

Can I Submit to a third data source

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mdsmitty - 25 May 2005 19:09 GMT
I have a form created from an SQL database and have added 3 tables from that
database as my datasoucres.  What I am trying to do is submit data to the 3rd
table.  The workflow of my form is as follows.

1.  An account number is entered into the form.
2.  This account number is contained in all 3 tables.
3.  Table 2 contains the demographics of the account and populates
demographic fields within the form.
4.  Additional fields within the form will be filled out by the user and
will need to be submitted to Table 3.

Is this possible in InfoPath and if so, what is the best way to accoplish
this?

Thanks in advance.
Scott L. Heim [MSFT] - 25 May 2005 21:23 GMT
Hi,

Are all the tables part of your "main" data source? If so, then when you
submit back to the database they should be updated. However, if any of the
tables are "secondary" data sources and these will need to be updated as
well then you will need to override the built-in submit functionality and
use custom code (look at the Submit method) to submit to any and all data
connections you have.

For instance, this is the same basic process you would use if you wanted to
submit to SQL and send an e-mail at the same time.

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
mdsmitty - 26 May 2005 13:04 GMT
All 3 tables are part of my main datasource...I want to use Tables 1 and 2 to
populate the form and submit data to Table 3.  The fields that are being
populated from tables 1 and 2 will be "read only".  The issue seems to be
that I can't use more than 2 tables in my Main Datasource.  The Submit
function from Tools->Submitting Forms does not give me a Database selection
from the drop-down in the Dialog Box when I have more than 2 tables.  I now
assume that I will need to write VBScript in order to accomplish this.  
Unfortunately I am very new to writing code and don't know how to put all
this together.

I have been going to the sites that have been suggested by yourself and Greg
to get sample code but at this point I can't find the sample code or I am not
modifying the code correctly when applying it to my form.

Any further help will be appreciated, thanks again for you help.

> Hi,
>
[quoted text clipped - 16 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
mdsmitty - 26 May 2005 15:47 GMT
I got it to work....the key in Table 3 was not set.

> Hi,
>
[quoted text clipped - 16 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
mdsmitty - 26 May 2005 23:15 GMT
Next problem...I want to be able to add new records to Table 3 within my data
source.  Here's how I am attempting to do this (without success at the
moment).

I have in Table 1 an Account Number (known to the user) and a Patient Number
(unknown to the user).  Table 2 also contains the Patient Number which gives
me the connection between the two tables.  Table 3 is blank and will contain
the Patient Number as well as information input into the form by the user.  I
want to be able to populate Table 3 "on the fly".  All 3 tables are part of
the "Main" datasource.

The issue seems to be that InfoPath will now allow me to select “Database”
from the Submit Dialog box (it is not available on the drop-down list).  I
have tried to submit the information to the database but I don’t have the
correct code.  The following error occurred:

InfoPath cannot submit the form.
Invalid context for OM call.
XDocument.Submit cannot be called from the XDocument::OnSubmitRequest handler.

File:script.vbs
Line:38

Can I do this with one form or will I need to create multiple forms/views?  
Any thoughts?

> Hi,
>
[quoted text clipped - 16 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.