Hi all,
i'm trying to retrieve some info from a SQL table but i keep getting an error saying i need to add the dbSeeChanges option. i have found some bits on this forum about it but i am doing something slightly different and it doesn't work when i add it.
Here's what i've got....
The red part is my SQL query result. In the other example the red text has speech marks ("st") aroung it but mine is coming from a variable and i get a type mismatch error.
Any ideas?
Cheers,
Spinkung.
i'm trying to retrieve some info from a SQL table but i keep getting an error saying i need to add the dbSeeChanges option. i have found some bits on this forum about it but i am doing something slightly different and it doesn't work when i add it.
Here's what i've got....
Code:
Dim st As String
Dim res As New Recordset
Dim db As Database
Set db = CurrentDb
ReqNo = Me.lab3.Caption
stkCod = RTrim(Me.lab4.Caption)
st = "SELECT dbo_tbl_RetRANrequest.UNID " & _
"FROM dbo_tbl_RetRANrequest " & _
"WHERE dbo_tbl_RetRANrequest.ReqNo = '" & ReqNo & "' " & _
"AND dbo_tbl_RetRANrequest.stockCode = '" & stkCod & "'"
Set res = db.OpenRecordset([COLOR="Red"]st[/COLOR], dbOpenDynaset, [dbSeeChanges])
The red part is my SQL query result. In the other example the red text has speech marks ("st") aroung it but mine is coming from a variable and i get a type mismatch error.
Any ideas?
Cheers,
Spinkung.