Forms and Combo Boxes

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

I am a beginner at Access so I don't know much. I am
trying to create a form to fill in a table so I can run
queries on the information in that table. I will be
printing a report from each record. My form has a combo
box that references a price list. It also has a control
that computes line item prices from the item found in the
combo box. My problem is, the data pulled from the list
in the combo box and the computed box are not moving to
the table. Can anyone help???

Thanks

Joe
 
Joe, If you want to store the value you select in your combobox to a field
in your table you need to have the combobox bound to that field. To do so
open the form in design view. Double-click on the combobox to open the
properties window. Select the Data tab and set the Control Source to the
field you want by selecting it from the drop down list. Set the rowsource
to your price list. Now when you select a price from the list the value
will be store in the field you've selected as your control source. As far
as the computed value goes, it's not advised to store a derived value in
your table's. Simple place a control on your form/report to display the
value when you want to see it.
 
Thanks for the reply. I have it set up as you suggested
and can understand about the computed field. THe problem
is when I select from the drop down list I want both the
item I select AND the price to move to the data table.
My price moves but the item selected does not. I have the
combo box set to select from a table that only has two
colums, item and price. I want both to be entered to the
table.
Thanks
Joe
 
Joe, Set the After Update event of the combo to something like this. Keep
in mind the combo boxes are zero(0) based so that column 1 is actual column
0.
I'm assuming that the item is in the first column.
Private Sub MyCombo_AfterUpdate()
Me.MyItemField = Me.MyCombo.Column(0)
Me.MyPriceField = Me.MyCombo.Column(1)
End Sub
 
Thanks
-----Original Message-----
Joe, Set the After Update event of the combo to something like this. Keep
in mind the combo boxes are zero(0) based so that column 1 is actual column
0.
I'm assuming that the item is in the first column.
Private Sub MyCombo_AfterUpdate()
Me.MyItemField = Me.MyCombo.Column(0)
Me.MyPriceField = Me.MyCombo.Column(1)
End Sub



--
Reggie

----------



.
 
Back
Top