Defaulting control values based on the selection of another contro

M

Mike in Arizona

I am a new user/develop of Infopath and I am developing this form and I have
run into issue. I want to design a form were the value of one control is
driven by the selected value of another control. For example, if the user
selects "Product X" from a drop-down list, I want the value of the ProductID
to default to the ID associated with that Product (this is not really my
dilema, but it illustrates the point). Any ideas how I might accomplish this?
 
B

Bojana Marjanovic [MSFT]

There are a couple of ways of doing this, Mike.

I'm assuming you have some sort of secondary data source that has a
repeating group 'Products' with two fields under it: 'ProductName' and
'ProductID'.

You can set the default value of the ProductID field in your form to point
to the ProductID field in the secondary data source, but filtered by the
ProductName field so that it equals whatever the user chose in the
drop-down.

You can also set a rule on the drop-down to populate the ProductID field
with the appropriate value. You would still select the ProductID field from
the secondary data source and filter it with the name of the Product that
was selected in the drop-down.

Filters are key here. When you have repeating groups, you can always select
the appropriate one by filtering based on one of the fields in the repeating
group.

Let me know if this helps,
Bojana
 
B

Barry

I am doing something similar, with a twist. I would like the default value
of the control to map to a table column that allows the value to be changed
and stores any use (default or changed).
The application is an invoice page where the combobox contains product names
from the 'Products' table. Once selected, I want the unitPrice control
populated with the base price (contained inthe Products table), however, this
value may be changed by the user. In either case, a unitPrice will be saved
in the resulting 'Sales' table.

Will these approaches work in this scenario? Do you have examples that I
can reference (I'm new to Access). Thanks.
-b
 
B

Barry

Oops. I just realized, my search was not constrained to the Access group.
Sorry if this is off-topic.
-b
 

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