Combo box value to Text Box

DMASRUD
DMASRUD used Ask the Experts™
on
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?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
You can try one of the following options:

Option1

Base the subform on the following query:

Select tblSales_Detail.SalesDetail_Id, tblSales_Detail.Sales_Id, tblSales_Detail.Prod_Id, qryProdRetailPrice.Sales_Price From tblSales_Detail INNER JOIN qryProdRetailPrice ON tblSales_Detail.Prod_Id = qryProdRetailPrice.Prod_Id

Option 1

Use the following code in the after update event of the combobox

Me.textboxname = me.comboboxname

Commented:
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.
Commented:
Dang, reread your code...make that Column(4) as it is the 5th field.

Author

Commented:
Thanks so much.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial