"You cancelled the previous operation" Error on Dlookup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matt753
    New Member
    • May 2010
    • 91

    "You cancelled the previous operation" Error on Dlookup

    I have the following Dlookup statement:

    Code:
    DLookup("[RateValue]", "[Rates]", "[Rate]=" & CStr(CRegion))
    I get the error: "You cancelled the previous operation".


    The field is not null, it contains a 'Number' value with 2 decimal places. It is going into a double variable.

    I have also tried it without the [], same result.


    The 'Where' part of the argument, the 'Rate' field is a text field and the 'CRegion' is a string. Are you only allowed to match numerical fields?
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    If Region is a String, why are you using CStr() to convert it to a String?

    And your syntax

    "[Rate]=" & CStr(CRegion)

    is correct for Numeric data, not correct for Text/String!

    It would be

    "[Rate] = '" & Me.CRegion & "'")

    Linq ;0)>

    Comment

    • matt753
      New Member
      • May 2010
      • 91

      #3
      Sorry, just put that in at the end but before I had "[Rate]"= & CRegion)

      Comment

      Working...