Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Puzzling mis-matched data type error... 3

Status
Not open for further replies.

GWhiz

Programmer
Dec 16, 1999
49
US
Hi, folks.

I'm using the .FindFirst method to locate a record in a recordset (RstData below) created by the OpenRecordset method. The field I'm searching ([ID]) has been defined as a text field, and I'm searching for a string value assigned to a variable (WO_ID) declared as a string:

RstData.FindFirst "[ID] = " & WO_ID

I keep getting a "data type mismatch" error -- and I can't figure out why.

In the same database, I've also used exactly the same setup and syntax, but with a field ([RptNum]) defined as a number, and a variable (LastRptNum) declared as an integer:

RstData.FindFirst "[RptNum] = " & LastRptNum

This works just fine.

Any clues as to why the number-oriented version of this works, while the string-oriented version doesn't?

Thanks for any help you can provide. This has left me scratching my head....and cursing Microsoft.

Respectfully,

GWhiz
 
Just a guess. Have you tried-

RstData.FindFirst "[ID] '= " & WO_ID & "'"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top