find method problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • runner7@fastmail.fm

    #1

    find method problem

    I have a recordset find method that works with a simple expression such
    as:

    "ProdID=100 "

    but when I use

    "ProdID=" & objR![Field]

    I keep getting an error about types mismatched or arguments out of
    range or incompatible or something like that.

    The 2 fields are of the same type and size. As far as I know, both
    recordsets have been properly opened. Can anyone give me a clue as to
    what is wrong?

  • kingston via AccessMonster.com

    #2
    Re: find method problem

    Is objR![Field] a numeric data type? If not, you'll have to use:
    "ProdID='" & objR![Field] & "'"
    Use a message box to display objR![Field] right before you assign it to see
    if there even is a value while you debug this.

    runner7@fastmai l.fm wrote:
    >I have a recordset find method that works with a simple expression such
    >as:
    >
    >"ProdID=100 "
    >
    >but when I use
    >
    >"ProdID=" & objR![Field]
    >
    >I keep getting an error about types mismatched or arguments out of
    >range or incompatible or something like that.
    >
    >The 2 fields are of the same type and size. As far as I know, both
    >recordsets have been properly opened. Can anyone give me a clue as to
    >what is wrong?
    --
    Message posted via http://www.accessmonster.com

    Comment

    • runner7@fastmail.fm

      #3
      Re: find method problem

      kingston via AccessMonster.c om wrote:
      Is objR![Field] a numeric data type? If not, you'll have to use:
      "ProdID='" & objR![Field] & "'"
      Thanks so much. Adding those single quotes solved the problem.

      Comment

      Working...