AfterUpdate() event

D

Darrin

I am pulling my hair out on this one. Everytime I use the combo box I get
"The object dosen't contain the automation object POrderDetails". The main
form is POrder and the subform is POrderDetails. The code below is attached
to the after update event of a combo box setting the price of an item after
it has been selected. Any suggestions?

Private Sub ProductID_AfterUpdate()
Dim strFilter As String
strFilter = "ProductID = " & Me!ProductID
Me![Cost/Pkg] = DLookup("[Cost/Pkg]", "Products", strFilter)

Exit_ProductID_AfterUpdate:
Exit Sub

Err_ProductID_AfterUpdate:
MsgBox Err.Description
Resume Exit_ProductID_AfterUpdate
End Sub
 
D

Duane Hookom

Have you considered adding the Cost/Pkg field to the Row Source of your
combo box? You could then use
Me![Cost/Pkg] = Me.cboProductID.Column(x)
Where x is the column in the combo box Row Source. x is zero-based.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top