Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database for my small business. When I input an order I select from a list of my products the one being ordered. I would like it if when I select a product from a combo box i would like it if it automaticlay enterded the products price in the proper field.
 
Zack

Add an unbound control (textbox) on your form, and make sure your combo
box's RecordSource includes the ProductPrice as one of its columns (even if
you don't display it).

In the combo box's AfterUpdate event, add the following (actual syntax may
vary):

Me!txtNewControlName = Me!cboYourComboBox.Column(n)

where the "n" for the Column is one less than the actual column number in
your source (this is a zero-based property, start counting, "0, 1, ...").

This will set the unbound control to the value of the column of the combo
box. If you wish to record the ProductPrice as part of an order record
(maybe your prices change over time), you'll need an OrderProductPrice field
in your table, and you can bind the control to that field.

Good luck

Jeff Boyce
<Access MVP>
 
Use the AfterUpdate event of the ProductID control to lookup the price in
the Product table.

To see an example:

1. Open the Northwind sample database (installed with Access).

2. Open the Orders Subform in design view.

3. Right-click the ProductID combo and choose Properties.

4. On the Event tab of the Properties box, click After Update.

5. Click the Build button (...) beside this.

Access opens the code window, and you can see how it works.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Zack said:
I have a database for my small business. When I input an order I select
from a list of my products the one being ordered. I would like it if when I
select a product from a combo box i would like it if it automaticlay
enterded the products price in the proper field.
 
Back
Top