Hi,
could someone let me know what is wrong with this code, that when I stepped into it to debug, always got error message 13 (Type Mismatch) after the sSQL.
My table is a linked table from Oracle database.
Thanks ahead.
Sub try()
Dim db As Database
Dim rs As Recordset
Dim sSQL As String
Dim var As String
Set db = CurrentDb
sSQL = "Select Opty_Type from Opportunity WHERE Opty_Type = 'Lost'"
Set rs = db.OpenRecordset(sSQL)
While Not rs.EOF
var = var & rs("Opty_Type" & Chr$(13)
Wend
Debug.Print var
rs.Close
End Sub
could someone let me know what is wrong with this code, that when I stepped into it to debug, always got error message 13 (Type Mismatch) after the sSQL.
My table is a linked table from Oracle database.
Thanks ahead.
Sub try()
Dim db As Database
Dim rs As Recordset
Dim sSQL As String
Dim var As String
Set db = CurrentDb
sSQL = "Select Opty_Type from Opportunity WHERE Opty_Type = 'Lost'"
Set rs = db.OpenRecordset(sSQL)
While Not rs.EOF
var = var & rs("Opty_Type" & Chr$(13)
Wend
Debug.Print var
rs.Close
End Sub