Database Add Record Problem

P

pete.trudell

I am fairly new to InfoPath, but I have to have an important form up
and running soon for our office , as the old Outlook form stopped
worked upon updating to Windows XP / Office 2003. I created a form
which is sumitted by staff to one specific staff member, upon receipt
that staff member can either send it to another department, kill it, or
send the information to our Database.

The form then has two buttons, one is the Submit button which send the
data to the database. the second button is programmed using jscripts to
send the form as an attachment to that specific staff member.

When I originally set it up, without the programmed button, the add
record worked (all fields are based on the Access Database (data
fields)). When I added the programmed button, the filled out form goes
to the specific staff member, but when they click the Submit button to
send the data to the database, they get several pop-ups.

1. Warnes that the form will be blanked upon completeion-- that's okay
2. Pop-up to warn that Datbases reconize you or something like that.
3. Then it fails with - InfoPath cannot submit the form. Before this
action can be completed, you must query the database for the data
associated with this form.-

I did not select any query fields, only data fields.

What Happened. I need a fix to complete this form for use.
Appreciated any help here, Thanks
 
S

S.Y.M. Wong-A-Ton

As you've described the problem, I'd look for the culprit in the JScript
code. Since you haven't provided the code, it is difficult to say where
things might be going wrong. Just out of curiosity: Why did you use code to
submit the form by email?
 
P

pete.trudell

I needed to have two buttons, one to e-mail the form to the Manager,
and one for the manager to send selected forms data to the Database.
When I tried to used the Submit button to send e-mail, and then create
the button to send the form data to the database that button failed
because the Submit button was for e-mail only.... that's the way it
looks to me.

So I decided to use my excel experience and create a Jscript to send
the e-mail. I got the Jscript from the Help files for sending e-mail.
I have only the InfoPath Program Help files to help me, so I am feeling
my way, trail and error is a better description.

As I said I had a very good Outlook form which worked for over 5 yrs.
Then we Upgraded to Windows XP / Office 2003 and my form will not
populate the database.... still trying to figure this out. However, my
boss expects me to get this fixed soon.... And we have no techical
fund.. If I don't figure it out--- we don't have it.

I'm at home for the weekend, I will send the Script on Monday. Thanks
 
S

S.Y.M. Wong-A-Ton

Please don't feel as if am trying to add to the stress you already have; I'm
just trying to understand your reasons for using code. :)

The reason why I asked is because you can also just add a data connection to
your form that will submit the form to an email address, and then use this
data connection in a rule on a button with an action that says "Submit using
a data connection". No code required.

Perhaps it might be a good idea to remove the button that uses code, check
if the database addition works, and then add a button that uses a rule to
submit to an email address, before we delve into debugging your code.
 
P

pete.trudell

Here is a problem, when I attempt to have two buttons, one to submit to
e-mail and one to Delete&Submit to a database, they cancel each other
out in that when I change the connection to sumit to e-mail, the
transfer button( used to submit additional recond to the database) is
change to e-mail.

What am I doing wrong.... it makes no sense.
 
S

S.Y.M. Wong-A-Ton

It sounds as if you're using one data connection for both submission to the
database as well as through email. If this is the case, you must add an extra
data connection for the email (through Tools > Data Connections...) and use
this one to submit through email. You must have 2 data connections in total:
1 for the database and 1 for the email.
 
P

pete.trudell

I have that, one main connection to the Database , and a main submit to
e-mail address.

However, when I attempt to make one button to Delete&Submit to the
database main connection, and the other button to Submit e-mail , it
still does not allow you to change one without it changing the other.

I'm really missing something here.
 
S

S.Y.M. Wong-A-Ton

Did you switch to using a rule or are you still using code for the email
button?
 

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