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
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