Avatar of jbakestull
jbakestull
 asked on

Access 2007 Data type mismatch in criteria expression

I'm not sure why I receiving this error.

Highlighted line is: Set rs = CurrentDb.OpenRecordset(strSQL)



Private Sub cbotest_AfterUpdate()
Dim rs As Recordset
Dim strSQL As String

 
strSQL = "select [intTotalScore] from tblVulnerabilityIndex where intCSPIdentifier=" & Me.cbotest & " And [intTotalScore] <> Null"
    Set rs = CurrentDb.OpenRecordset(strSQL)
    If Not rs.EOF Then
        Me.txtVulscore = strSQL
    End If
   
End Sub
Microsoft AccessSQL

Avatar of undefined
Last Comment
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

8/22/2022 - Mon
SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

OR

strSQL = "select [intTotalScore] from tblVulnerabilityIndex where intCSPIdentifier="  & Chr(34) & Me.cbotest & Chr(34) & " And Not IsNull([intTotalScore])"
jbakestull

ASKER
in the Me.txtVulscore box, the SQL statement is populating, not a value.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Well, that's what you have ...

Me.txtVulscore = strSQL

What is your intent ?

mx
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Of course, it  rs instead of rst ....