Drop down box?

  • Thread starter Thread starter Evil-Penguin
  • Start date Start date
E

Evil-Penguin

Hi, i am trying to learn to use microsoft access, and and i have
problem getting data from a table, and can't find a solution on google
and i've looked through therse fourms but seem unable to find a
answer.

My problem is, i have a table with a product code and price and i'v
made a form with a drop down box to choose the product code, but whe
it is selected, i want the price field to change to that in the table
i think it shouldn't be too hard, but i'm new to it, and dont know ho
to do it, so if anyone can tell me how to do it, i'd appreciate it.

Thanks :
 
If you have:

tblProduct
ProductID (PK)
ProductDescription
ProductPrice

and a frmProduct containing a cboProduct (combo box) which returns the
ProductID and displays ProductDescription.

You want to see ProductPrice in txtProductPrice (text box) to the right of
the combo box. When you change the selection in cboProduct, txtProductPrice
changes.

In txtProductPrice type:

=[cboProduct].[Column](1) or
=[Forms]![frmProduct]![cboProduct].[Column](1)

(Ifyou don't type the square brackets Access will display them)

Using the column property you can have several text boxes each displaying
any field. If the number of columns the clmbo box has is 3, the column
references would be 0, 1, 0r 2. The left field starts with 0.

Set txtProductPrice format to "Standard" Decimal places to 2 for dollars and
cents ex.: 1,234.56.
 
GFY - Keep trying. Access has multiple ways to do common tasks. You're not
an expert until you've learned how to make all the common mistakes! Access
is also an underrated application; it's very powerful once you have a
comfort level using it.
 
Back
Top