Run Time Error

taloker

Registered User.
Local time
Yesterday, 16:10
Joined
Mar 27, 2012
Messages
13
Hi
All helpers
I have a problem with VBA code of "DLookup"

I am trying the following code which works well
Private Sub Price_AfterUpdate() Product = DLookup("Product", "LU Product", "Price=" & Price) End Sub
BUT
when I apply with reverse order it does not work and shows run time ERROR 3464
Private Sub Product_AfterUpdate() Price = DLookup("Pricec", "LU Product", "Product=" & Product) End Sub In the both the tables the PRICE is currency and product is TEXT

:confused:
Please help me
My project is only lacking and waitng for this CODE
Pleasse write down the CODE
thanks
 
Private Sub Product_AfterUpdate()
Price = DLookup("Pricec", "LU Product", "Product=" & Product)
End Sub


Because Product is text, you need to use quotes

Price = DLookup("Pricec", "LU Product", "Product='" & Product & "'")
 

Users who are viewing this thread

Back
Top Bottom