Connecting Tech Pros Worldwide Help | Site Map

find method problem

runner7@fastmail.fm
Guest
 
Posts: n/a
#1: Nov 14 '06
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
Guest
 
Posts: n/a
#2: Nov 14 '06

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@fastmail.fm wrote:
Quote:
>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

runner7@fastmail.fm
Guest
 
Posts: n/a
#3: Nov 15 '06

re: find method problem


kingston via AccessMonster.com wrote:
Quote:
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.

Closed Thread