I have found that (yet again) I am having problems with SQL, I dont know if I am being daft or otherwise.
Now the error I get is "Data Type Mismatch in Criteria expression." after running the contents of the msgbox (just above) through the SQL Query generator in access. this returns the same error.Code:Dim sqlSearcher as String Dim FormUserID as String Dim FormNumber as Integer sqlSearcher = "Select * FROM tblUserForms" sqlSearcher = sqlSearcher & " " & "WHERE [UserID_] = '" & FormUserID & "' and [FormIDno_] = '" & FormNumber & "'" msgbox sqlSearcher ' this then dispays "sqlSearcher = Select * FROM tblUserForms WHERE [UserID_] = 'jfreeman' and [FormIDno_] = '7'
I ran the following SQL query through access and it worked fine
I have tried removing the ticks after the WHERE [UserID_] = '" & FormNumber & "'" and this makes no difference, I tried removing all the quotes and juggling them, to no avail.Code:Select * FROM tblUserForms WHERE [UserID_] = 'jfreeman' and [FormIDno_] = 7
Please someone tell me this is a complicated problem as I am beginning to feel a bit of a fool for regularly asking some seemingly silly questions...
Thanks
J




Reply With Quote