Use Command button on one from to open another

R

Rock*

I am building my first infopath form and my experience is rather limited and
I thank you for your patience in advance..

I would like to enter a value in a form and after clicking on a command
button next to it 2 things need to happen:
The entered value will be evaluated against a list of values and if it isn't
in it, the user will get a message to try again. Otherwise, another form will
open up and the value entered in the first one will be also reflected in the
second.

Is this possible?

Thank you so much for your help.
 
S

S.Y.M. Wong-A-Ton

Yes, it is possible and relatively easy to implement if you use 2 views in 1
InfoPath form instead of 2 instances InfoPath.

Here is a general outline of the steps:
- Create a new InfoPath form
- Add a second view to your form
- Create an XML file containing the list of values to check against and add
it to your form as a secondary data source (Tools > Data Connections).
- Next add a button and a text field (field1) to the first view (the default
view).
- Add a text field (field2) to the second view.
- Go back to the first view and add two rules on the button:
1. The first rule must have a condition set on it that checks whether the
value of field1 is equal to one of the values in the secondary data source,
one action that switches to the second view, and a second action that sets
the value of field2 equal to that of field1.
2. The second rule must have a condition set on it that checks whether the
value of field1 is not equal to any of the values in the secondary data
source, and one action
that shows a dialog box message.

Some of the steps I've mentioned are also described in the labs at:
http://msdn.microsoft.com/office/understanding/infopath/training/default.aspx

S.Y.M. Wong-A-Ton
 
G

Greg Collins [InfoPath MVP]

The first thing to identify is whether you *really* need to have 2 forms, or just 2 views. You can do what you want with 2 forms, but it gets to be quite complicated and usually involves quite a bit of coding to make sure that you cover all the weird situations a user can get into when dealing with 2 forms at once. It takes a lot of work to make things run smoothly.

If you don't absolutely need to open another "form"--then don't go there.

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


I am building my first infopath form and my experience is rather limited and
I thank you for your patience in advance..

I would like to enter a value in a form and after clicking on a command
button next to it 2 things need to happen:
The entered value will be evaluated against a list of values and if it isn't
in it, the user will get a message to try again. Otherwise, another form will
open up and the value entered in the first one will be also reflected in the
second.

Is this possible?

Thank you so much for your help.
 

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