M
Mick
Hi All
Am using a form/subform and wish to look up a price from an unrelated
entity.
Hence subform has:
[ProductName] which is a text primary key. It needs to look up
[ProductPrice] from tblProduct and return it into [ProductPrice] on
the subform.
If I hard code it as:
______________________-
Me!ProductPrice = DLookup("[ProductPrice]", "tblProduct",
"[ProductName] = 'Kayak' ")
___________________________________
It works fine. However, when I replace the [ProductName] with a combo
and try:
____________________________________________________________-
Dim grabvalue As String
grabvalue = "ProductName = " & "'" & Me!ProductName & "'"
Me!ProductPrice = DLookup("[ProductPrice]", "tblProduct",
"[ProductName] = 'grabvalue' ")
__________________________________________________________-
An error is thrown. An msgbox returns ProuctName = 'Kayak' but doesn't
execute.
How do I get the result of the combo to evaluate to the same as hard
code.
Any help appreciated.
Mick
Am using a form/subform and wish to look up a price from an unrelated
entity.
Hence subform has:
[ProductName] which is a text primary key. It needs to look up
[ProductPrice] from tblProduct and return it into [ProductPrice] on
the subform.
If I hard code it as:
______________________-
Me!ProductPrice = DLookup("[ProductPrice]", "tblProduct",
"[ProductName] = 'Kayak' ")
___________________________________
It works fine. However, when I replace the [ProductName] with a combo
and try:
____________________________________________________________-
Dim grabvalue As String
grabvalue = "ProductName = " & "'" & Me!ProductName & "'"
Me!ProductPrice = DLookup("[ProductPrice]", "tblProduct",
"[ProductName] = 'grabvalue' ")
__________________________________________________________-
An error is thrown. An msgbox returns ProuctName = 'Kayak' but doesn't
execute.
How do I get the result of the combo to evaluate to the same as hard
code.
Any help appreciated.
Mick