I am completely stumped on what seems to be a completely simple thing.
What I'm trying to do is use a SELECT CASE with a recordset. The SELECT CASE looks at one field from the recordset to establish the CASE's. I looked at the table that this field comes from and the field's data type is "text." When I make my CASE's, the program runs fine if I just put numbers for the requirements.
I.E. Case "734"
The problem I am having is that as soon as I enter in any type of text for the requirement of the CASE, I get a "Type Mismatch" Error.
I.E. Case "INACTIVE 734"
I've posted some of my code below:
Could someone tell me why I'm getting this error?
Thanks!
What I'm trying to do is use a SELECT CASE with a recordset. The SELECT CASE looks at one field from the recordset to establish the CASE's. I looked at the table that this field comes from and the field's data type is "text." When I make my CASE's, the program runs fine if I just put numbers for the requirements.
I.E. Case "734"
The problem I am having is that as soon as I enter in any type of text for the requirement of the CASE, I get a "Type Mismatch" Error.
I.E. Case "INACTIVE 734"
I've posted some of my code below:
Code:
Set jobnumrcdset = db.OpenRecordset("SELECT JobNumbers.[Job Number], JobNumbers.[Machine #] " + _
"FROM JobNumbers ORDER BY JobNumbers.[Job Number];", dbOpenDynaset)
Select Case jobnumrcdset![Machine #]
Case "734" Or "735" Or "901" Or "894" Or "1094" Or "981" Or "INACTIVE 734"
jobnumrcdset.Edit
jobnumrcdset![Machine #] = sInactive & jobnumrcdset![Machine #]
jobnumrcdset.Update
Case Else
End Select
Could someone tell me why I'm getting this error?
Thanks!
Comment