Combo Boxes on Forms

G

Guest

What am I doing wrong? When I create a combo box to look up a price value
stored in my products table, I can not get access to use the value I really
want. My products table has a "description field" and "unit price field". I
need to see the descriptions so I can pick the proper price, but everything
I've tried results in the "description" being placed in the form field "Unit
Price".
Thanks,
Mike
 
G

Guest

Open the form in design view and open the Properties dialog for the combo
box, on the Data tab you will find a item named 'Bound Column'. This permit
you to set which column has the data that you wish to be stored.

Adjust the values to the column that actually contains the price.

Daniel
 
G

Guest

Did you use the wizard to generate the combo box? If so it is in the wizard
where the colunm to choose from is assigned to the field to drop the value in
but the answer from Daniel should sort the problem out.

HTH Kindest Regards, Mike
 
G

Guest

Yes, the wizard created the combo box. It also created another combo box on
the same form that is used to pick a product description, which works fine.
The closest I get to making the second combo box work either replaces the
value in the first field or returns an error message: "The value you entered
isn't valid for this field. You may have entered text in a numeric field or a
number that is larger than the fieldsize setting permits" I've tried changing
the UnitPrice field from text to number with no luck.
This is what appears in the properties of the "productdescription" combo box
- SELECT Products.ProductDescription, Products.ProductID FROM Products; Why
won't it work if I write this - SELECT Products.UnitPrice,
Products.ProductDescription FROM Products;
Mike
 
G

Guest

There must be a reason for the wizard to be failing. There are two more
obvious uses for a Combo Box.

1 to look up a value in your records
2 to look up a value in a table or query and asign that value to the
nominated field on the form. Assuming you are using the latter option to
select a value from a table and asign it to a control or field. As you have
one Combo that works already, there must be some reason the second is not
working.

Checks

The format of the lookup table field and the field the value is to be
asigned to must be formatted in the same way, Text to Text, Currnecy to
Currency, etc to etc

I would suggest you check the formats of the fields in each table????

Hope this helps
 
G

Guest

Mike,
I double checked all my fields, they're formatted the same. Here are my
steps from each wizard box;
Look up values in a - table.
Which Table - Products
Which Fields - ProductDescription, Unit Price
What sort order - ProductDescription
How Wide - Hide key column is checked, I do adjust the width to see the
description column. (I've tried it both ways)
Store that value in - UnitPrice (I deleted the original text field on the
subform so I could replace it with this combo)
What Label - Unit Price
When I save and close the subform, then open the main form that it resides
in, the price is displayed properly in the existing records. When I try to
enter a new record in the existing subform, the combo appears showing both
desc and price. I select the value I need and access displays the previous
error message then inserts the desc. It I change the bound column properties
to 2, message disappears but desc is placed in field.
I'm lost.
Mike
 
G

Guest

Mike, I have returned your programme complete with a combo box if I have
understood the issue correctly????

Please let me know if I have got it right?

I have also explained how I generated the comboBox and have sent a few more
tips on a second e mail.

I hope this helps you?

Let me know?

Kindest Regards
MJB

--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all
and asked everyone you know,
read the instruction manual.
 

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