Drop down list question.

D

David Fredman

This may be simple...but I'm new to this. I have an InfoPath template set up
that is linked to an Access db. I have a drop down list that contains about
50 names, each assigned a decimal value (some have the same value). When I
select a name at the top, the list will automatically display a name lower in
the list if it has the same value. How can I fix this? Any tips or advise
would be appreciated. Thanks.
 
S

Scott L. Heim [MSFT]

Hi David,

Can you provide some additional details as to how you created your InfoPath
solution, what controls you are using and what you are seeing?

For instance, it makes sense that you have a drop-down list that has 50
names but what do you mean by "each has a decimal value?" Then, you
indicate: "When I select a name at the top, the list will automatically
display a name lower in the list if it has the same value" - I am not
following what you mean here.

When you created your InfoPath form, did you create it *FROM* a "data
connection?" I am assuming the 50 names are coming from an Access table -
is this correct?

I am sorry for the additional questions but I am not clear on your setup or
the behavior you are seeing.

Thanks,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Fredman

Hi Scott,

I did not create this from a data connection. I just linked from the drop
down list properties box to the Access table.
What I have is drop down list with 50 items. In the table I have a column
for name and a column for price (this is the decimal value i was talking
about). What I'm going for is when I select the item in the drop down list,
it automatically populates the price into a field next to it. This is
working fine except...
If I select an item at the top of the drop down list that has the same price
as an item at the bottom of the list, it will display the name of the lower
item.
Thanks
 
V

virgul

Hi,

If I have good understand in your dropdown:

Value: price

Display: the name


and you copy this value in another field!

The problem is if the price is the same infopath select automatically
the lowest in your listebox I have the same problem ! It's certainly a
bug of Infopath!

The best things to walktrough this problem is to make a rules and have
the name for the value and display in the dropdown:

Make a rules : take the price when name of the dropdown is the same
contain in the secondary data source ands copy it yin your fields!

++

Thierry
 
S

Scott L. Heim [MSFT]

Hi David,

Thank you for the clarification. I understand the behavior you are seeing
as I was able to reproduce the same basic behavior when I created a table
in Access with the following fields and values:

myText myPrice
A 1.10
B 2.20
C 3.30
D 4.40
A 5.50

For me, regardless of which "A" I select, I always get 1.10. Now to be
clear, this is not a bug. In fact, Access works the same way if you use a
combo-box on a form where the combo-box is used to select a record in your
form.

When you setup a Rule in InfoPath to set a field's value, you are basically
saying: "set this other field's value to the value in the "price" field
where the text matches the text I selected in my drop-down box."

There is no way for an application to know you selected the "last" A versus
the "first" A. The way around this is to insure you have set a primary key
in your Access table and then use this field as the "Value" field for your
drop-down box. This way when you add the Rule and implement the Filter, you
would now be saying: "set this other field's value to the value in the
"price" field where the primary key matches the value I selected in my
drop-down box."

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
V

virgul

Hi,

What I say by define a rules is:

Is the different choice of your listebox in a secondary data source? if
not the end of my message change (you have to send one more fields in
your primary datasource)!

In the secondary datasource you have two fields (or more) in a
reapeating section ? Is it wright ?

Like I say in my other post if you are the same value for the value
field in the listebox choice infopath select automatically the lowest
in the listebox!

So what you have to do is (If you have unique name in your secondary
datasource!) in your listebox (link it to a field of your secondary
datasource "name" for example) put the name for value and display. and
in the listebox rule define a rules who put depends on the name choosen
put the price in the textbox (the textbox who is in the primary
datasource)! It 's the best things that you can make for do that!


++

Thierry
 

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