Morning,
I am trying to run an t-sql statement in my vb and put it in a recordset but when i try to put it in rs2 (my recordset object) i get a 'type mismatch' error.
The red highlighted text is where the error occurs. Can anyone see why??
This is the debug.print result.....
Thanks,
Spinkung.
I am trying to run an t-sql statement in my vb and put it in a recordset but when i try to put it in rs2 (my recordset object) i get a 'type mismatch' error.
The red highlighted text is where the error occurs. Can anyone see why??
Code:
sql = "SELECT * FROM [Serial Tracked Stockcodes] WHERE [Serial Tracked Stockcodes].[Stockcode] = '" & stk & "'"
[COLOR="Red"]Set rs2 = CurrentDb.OpenRecordset(sql)[/COLOR]
This is the debug.print result.....
Code:
SELECT * FROM [Serial Tracked Stockcodes] WHERE [Serial Tracked Stockcodes].[Stockcode] = 'UKB000518'
Thanks,
Spinkung.