DMASRUD
asked on
Combo box value to Text Box
QUESTION IS AT BOTTOM. HERE IS THE BACKGROUND:
I have a main form called:
frmSales (to enter data to tblProdSales)
with fields:
Sales_Id (primary field)
Cust_Id (combo box to select)
Staff_Id (combo box to select)
Sales_PmtType
Sales_Comment
With a subform called:
sfrmSales_Detail (to enter data to tblSales_Detail)
subform is linked to frmSales by Sales_Id
subform has fields:
SalesDetail_Id (primary key)
Sales_Id
Prod_Id (completed thru Combo box ProductPick)
Sales_Price
Sales_Units
Combo box ProductPick is written:
SELECT Prod_Id, Product, Vendor, Line, Price, Unit FROM qryProdRetailPrice
Column Count 6
Column Widths 0";3.5";1.3";0";0.7";0.3"
Question: How do I get the Price value from the combo box ProductPick into the Price field?
I have a main form called:
frmSales (to enter data to tblProdSales)
with fields:
Sales_Id (primary field)
Cust_Id (combo box to select)
Staff_Id (combo box to select)
Sales_PmtType
Sales_Comment
With a subform called:
sfrmSales_Detail (to enter data to tblSales_Detail)
subform is linked to frmSales by Sales_Id
subform has fields:
SalesDetail_Id (primary key)
Sales_Id
Prod_Id (completed thru Combo box ProductPick)
Sales_Price
Sales_Units
Combo box ProductPick is written:
SELECT Prod_Id, Product, Vendor, Line, Price, Unit FROM qryProdRetailPrice
Column Count 6
Column Widths 0";3.5";1.3";0";0.7";0.3"
Question: How do I get the Price value from the combo box ProductPick into the Price field?
Me.txtBox=Me.Combo.Column( 5) '5 is chosen here based on Price being the 6th field in your code above, the first column being column 0
Add this to the On Change Event of the Combo Box.
Add this to the On Change Event of the Combo Box.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much.
Option1
Base the subform on the following query:
Select tblSales_Detail.SalesDetai
Option 1
Use the following code in the after update event of the combobox
Me.textboxname = me.comboboxname