Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form code

Status
Not open for further replies.

rich001

Programmer
Feb 24, 2006
9
0
0
US
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
 
IF the txtbox you are updating with the price is in the subform I think you have to do it like Forms!subformname.txtboxname=something.
 
Have you tried changing the field name "Cost/Pkg" to maybe just "Cost" for both POrderDetails & Products tables just to see if works. Maybe its the "/" thats ????

and maybe:
Me![Cost] = DLookup("[Cost]", "Products", strFilter)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top