[Solved] Error 35, Subform DLookUp Solution
I am stuck on something that's probably easy for one of you to fix. Here's the problem. On my subform, I have 2 controls. One combo box that displays a list of product codes and product names. Beside it is the BaseCaseCost.
I need the after update property of Product Code, to look at the code and go find the BaseCaseCost from a query called, Base Case Price.
Private Sub Product_Code_AfterUpdate()
'Initialize price for each product change
If Not IsNull(Me![Product Code]) Then
Me![BaseCaseCost] = GetBaseCaseCost(Me![Product Code])
'Empty Product records mean user wants to delete lien item
Else
eh.TryToRunCommand acCmdDeleteRecord
End If
End Sub
Then Function GetBaseCaseCost(Product Code As Long) As Currency
GetBaseCaseCost = DLookupNumberWrapper("[BaseCaseCost]", "Base Case Price", "[Product Code] = " & Product Code)
End Function
I borrowed the from Northwind but I'm obviously changed it improperly. I get Error 35. I'm happy to get this another way. Any other suggestions?
I am stuck on something that's probably easy for one of you to fix. Here's the problem. On my subform, I have 2 controls. One combo box that displays a list of product codes and product names. Beside it is the BaseCaseCost.
I need the after update property of Product Code, to look at the code and go find the BaseCaseCost from a query called, Base Case Price.
Private Sub Product_Code_AfterUpdate()
'Initialize price for each product change
If Not IsNull(Me![Product Code]) Then
Me![BaseCaseCost] = GetBaseCaseCost(Me![Product Code])
'Empty Product records mean user wants to delete lien item
Else
eh.TryToRunCommand acCmdDeleteRecord
End If
End Sub
Then Function GetBaseCaseCost(Product Code As Long) As Currency
GetBaseCaseCost = DLookupNumberWrapper("[BaseCaseCost]", "Base Case Price", "[Product Code] = " & Product Code)
End Function
I borrowed the from Northwind but I'm obviously changed it improperly. I get Error 35. I'm happy to get this another way. Any other suggestions?
Last edited: