Error: 3464 Data type mismatch

E

Evan M

Hello, I am receiving an error at "Set rs5 = ...". Can someone please tell
me where they think the error is? I am at a loss as to what could be causing
the problem. Error 3464:Data Type Mismatch in criteria expression

Dim db as DAO.Database
Dim rs5 as DAO.Recordset
Dim quoteidval As Integer
Dim kk As String

quoteidval = Me.QuoteID.Value 'this is pulled from the open form

Set db = CurrentDb

dimkk = "SELECT tblSystemInquiriesLineItems.LineID,
tblSystemInquiriesLineItems.QuoteID, tblSystemInquiriesLineItems.Quote,
tblSystemInquiriesLineItems.BluebookID FROM tblSystemInquiriesLineItems
WHERE ((tblSystemInquiriesLineItems.BluebookID=" & quoteidval & "))"

Set rs5 = db.OpenRecordset(dimkk)


Evan M
evan AT radiologyonesource DOT com
 
D

Dirk Goldgar

Evan M said:
Hello, I am receiving an error at "Set rs5 = ...". Can someone please
tell me where they think the error is? I am at a loss as to what
could be causing the problem. Error 3464:Data Type Mismatch in
criteria expression

Dim db as DAO.Database
Dim rs5 as DAO.Recordset
Dim quoteidval As Integer
Dim kk As String

quoteidval = Me.QuoteID.Value 'this is pulled from the open form

Set db = CurrentDb

dimkk = "SELECT tblSystemInquiriesLineItems.LineID,
tblSystemInquiriesLineItems.QuoteID,
tblSystemInquiriesLineItems.Quote,
tblSystemInquiriesLineItems.BluebookID FROM
tblSystemInquiriesLineItems WHERE
((tblSystemInquiriesLineItems.BluebookID=" & quoteidval & "))"

Set rs5 = db.OpenRecordset(dimkk)


Evan M
evan AT radiologyonesource DOT com

Probably BluebookID is a number field and quoteidval is text, or vice
versa. If BluebookID is text, you need to put quotes around quoteidval
when you embed it in the SQL string:

... tblSystemInquiriesLineItems.BluebookID='" & quoteidval & "'"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top