Having a little trouble returning a record count? ? - I need to return the following SQL statement and when I step through the code I get > BOF or EOF is true....
and the record count property = 0
things seem to be pointing towards the SQL statement ?
can anyone see a funny in the SQL?
By the way the variable MainFCode is a string
Any ideas would be appreciated
Set rst3 = New ADODB.Recordset 'create a new instance of the rst3 recordset
'Define the SQL statement that will get the "Sub-catogory's"
strSQL_3 = "SELECT tblSubCodes.Codes,tblSubCodes.Desc " _
& "From tblSubCodes " _
& "WHERE (((tblSubCodes.Codes) " _
& "Like" & " " & "'" & MainFCode & "*" & "'" & "));"
'Get the "Sub-catogory's"
If Not rst3.State = adStateOpen Then
rst3.Open strSQL_3, GetCon, adLockOptimistic, adCmdText
With rst3
.MoveLast
.MoveFirst
CRecords3 = rst3.RecordCount
End With
End If
Cheers
and the record count property = 0
things seem to be pointing towards the SQL statement ?
can anyone see a funny in the SQL?
By the way the variable MainFCode is a string
Any ideas would be appreciated
Set rst3 = New ADODB.Recordset 'create a new instance of the rst3 recordset
'Define the SQL statement that will get the "Sub-catogory's"
strSQL_3 = "SELECT tblSubCodes.Codes,tblSubCodes.Desc " _
& "From tblSubCodes " _
& "WHERE (((tblSubCodes.Codes) " _
& "Like" & " " & "'" & MainFCode & "*" & "'" & "));"
'Get the "Sub-catogory's"
If Not rst3.State = adStateOpen Then
rst3.Open strSQL_3, GetCon, adLockOptimistic, adCmdText
With rst3
.MoveLast
.MoveFirst
CRecords3 = rst3.RecordCount
End With
End If
Cheers