AfterUpdate() event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
Back
Top