Dlookup Evaluating To Null

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ineedahelp
    New Member
    • Sep 2006
    • 98

    Dlookup Evaluating To Null

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

    varRate = DLookup("[MarketPrice]", "Quadriserv_102 306", "[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_102 306", "MarketPric e = 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!
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    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_102 306", "[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_102 306", "MarketPric e = 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.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32662

      #3
      Originally posted by INeedaHelp
      varRate = Dlookup ("[Symbol]", "Quadriserv_102 306", "MarketPric e = 5.05")
      ?varRate
      AA*
      This was helpful - can you post the same for the other way around?
      ...So show results for
      Code:
      varRate = DLookUp("[MarketPrice]", "Quadriserv_102306", "[Symbol]='AA*'")
      ?"=" & varRate & "="

      Comment

      Working...