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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another type mismatch error

Status
Not open for further replies.

haneen97

Programmer
Dec 10, 2002
280
US
Hi,
I am getting type mismatch error on the last line in the code below. I think it is resulting fromt the table field (Product_Id) is an autonumber.

Can you please help?


Dim PId
.
.
.
Set RS = MyConn.execute("SELECT * FROM Product where format(Product_Id) = '%" & ProdFound &"%'")

PId = RS("Product_Id")

Thanks

Mo
 
Hello haneen97!

Try something like this...
Code:
Set RS = MyConn.execute("SELECT * FROM Product where Product_Id = " & ProdFound)
I think you're having problems because Product_Id is a number, and the quotes imply a string.

Good luck!

He who has knowledge spares his words, and a man of understanding is of a calm spirit. Even a fool is counted wise when he holds his peace; when he shuts his lips, he is considered perceptive. - King Solomon
 
I am still getting that error at the same line. This is how ProdFound getting the value:
ProdFound = request("ProdId")

Am I missing something?

Thanks.

Mo
 
And this ?
Set RS = MyConn.Execute("SELECT * FROM Product WHERE Product_Id=" & ProdFound)
If Not (RS.BOF Or RS.EOF) Then
PId = CLng(RS("Product_Id"))
End If


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top