combo box and subform help

  • Thread starter Thread starter jtidwell
  • Start date Start date
J

jtidwell

In my subform for each seperate order, I want to beable to select a
descripton name from the combo box. When the description name is selected,
the price associated with that name should come up in the subform. I have
tried to put the combo box in the table for description and make a query
but, the information associated with the description name will not come up.
 
Create the combo box cboItem with the RowSource something like:

SELECT tblItem.ItemKey, tblItem.ItemDescription, tblItem.SellPrice FROM
tblItem;

Set the number of columns to 3
Set the column widths to 0;2;0 or something else appropriate

Create the text box to hold the item price txtPrice:

In the Control Source of the txtPrice place:

=cboItem.column(2)


If the txtPrice Text Box is bound to a field then instead of setting the
Control Source as above, in the After Update event of the combo box place
code similar to the following:

Private Sub cboItem_BeforeUpdate(Cancel As Integer)
Me.txtPrice = Me.cboItem.Column(2)
End Sub
 
What do you want to do once you have figured out how to put the price into
the subform?

You have to be careful with storing price changes and calculations in forms.
 
Back
Top