Connecting Tech Pros Worldwide Help | Site Map

Dlookup Evaluating To Null

Member
 
Join Date: Sep 2006
Posts: 98
#1: Nov 7 '06
I have been struggling with the code below and wondering why it continues to return a NULL value.

varRate = DLookup("[MarketPrice]", "Quadriserv_102306", "[symbol] = '" & strSymbol & "'")

MarketPrice is of type Number/Double and Symbol is a text field. I am wondering if the DLOOKUP function can have a Non-text field as the EXPRESSION. When I switch things around....

varRate = Dlookup ("[Symbol]", "Quadriserv_102306", "MarketPrice = 5.05")
?varRate
AA*

It works just fine!!! Can anyone tell me if DLOOKUP can have a double number as the expression? If not, why not? Thank you and pulling my hair out!
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,865
#2: Nov 7 '06

re: Dlookup Evaluating To Null


Quote:

Originally Posted by ineedahelp

I have been struggling with the code below and wondering why it continues to return a NULL value.

varRate = DLookup("[MarketPrice]", "Quadriserv_102306", "[symbol] = '" & strSymbol & "'")

MarketPrice is of type Number/Double and Symbol is a text field. I am wondering if the DLOOKUP function can have a Non-text field as the EXPRESSION. When I switch things around....

varRate = Dlookup ("[Symbol]", "Quadriserv_102306", "MarketPrice = 5.05")
?varRate
AA*
It works just fine!!! Can anyone tell me if DLOOKUP can have a double number as the expression? If not, why not? Thank you and pulling my hair out!

What is the datatype of VarRate

Look at my post on your previous question on this issue.
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,714
#3: Nov 8 '06

re: Dlookup Evaluating To Null


Quote:

Originally Posted by INeedaHelp

varRate = Dlookup ("[Symbol]", "Quadriserv_102306", "MarketPrice = 5.05")
?varRate
AA*

This was helpful - can you post the same for the other way around?
...So show results for
Expand|Select|Wrap|Line Numbers
  1. varRate = DLookUp("[MarketPrice]", "Quadriserv_102306", "[Symbol]='AA*'")
  2. ?"=" & varRate & "="
Reply


Similar Microsoft Access / VBA bytes