Submit to DB & Email

T

Tiff

Hi,

I've designed a change request form based on an access Database.

Currently, I've designed it so the client fills in the form and then hits
the submit button and it go's into our mailbox. From here I review the
request, work out who to assign it to and fill in a few more fields, then I
want to submit it to our database.

I created a second view, where I can fill in the extra fields and submit to
the database. The primary view is for the client, where I want the submit to
go to our mailbox.

Every time I change the submit button on one view- it changes on the other.
I don't appear to be able to have both an email and database submit in the
same form - is it possible to do so and can you explain in simple english for
me as I don't program!!

------------------------------------------------------------------------------------------
If its not possible to do so, I could get the user to submit it directly to
the access DB but I have a couple of questions:
1). Not all of the users have access to the network drive the DB is on -
will the form still load up okay?
2). When I took over this area, the requests started at ID 35. Each new
request gets an ID equal to the last one +1 (ie; 36, then 37 etc;). As I
started at request 35, I set the ID field in access to a text rather than
auto number, so that it could start at 35. If the user loads the form
directly in, I need the primary key to continue incrementing - is there a way
I can look up the last record and add 1 to that field as a default value in
the form - so that when it loads, it has the correct primary key.

Please Help!
Regards,
Tiffany.
 
M

marco

hello tiff,

i remember the same problem, but not the solution. please check the id of
the button it seams to be the same. to check this, doubleclick on the button.
if you use "rules and managed code" (i don´t know the right words because i
use a german version of infopath) you will see the id. do the same with the
second button. they should have different ids.

hope i could help you

marco

(sorry for my bad english ;-()
 
S

Scott L. Heim [MSFT]

Hi,

You will need to add a new Data Connection that performs the "email submit"
functionality and then modify your submit buttons so that you use custom
code to do each submit.

For example, let's say your database connection is called: dbSubmit and the
e-mail connection is called: EmailSubmit. The code on the button to submit
the e-mail would be:

XDocument.DataAdapters("EmailSubmit").Submit

Whereas the code on the button to perform the database submit would be:

XDocument.DataAdapters("dbSubmit").Submit

The other option is to use a "Rule" on each button:

- Right-click on a button and choose Properties
- Click the Rules button
- Click Add
- Click Add Action
- Choose Submit Using a Data Connection from the Action box
- Select the appropriate Submit connection from the Data Connection
drop-down box
- Click OK 4 times to get you back to Design view
- Repeat the above steps for the other submit button

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.
 
T

Tiff

Hi,

Thank you both, I now have it working. I checked the controls had different
id's and then I went through the process Scott listed below for the DB Submit
control.

It seems to be working okay now.

Thank you,
Tiffany.
 

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