Basic syntax in recordset
Posted on 2011-09-16
This is the code I am using for the recordset.
Dim rst As ADODB.recordset
Dim strSql As String
Set cnn = CurrentProject.Connection
strSql = "SELECT PrimaryKey, NEWRSKTB.DIV, SEQ, PROCF, PROCT, HCPCF, HCPCT, P, PV, T, SP " _
& "FROM NEWRSKTB LEFT JOIN Column_Set_Division ON NEWRSKTB.COL = Column_Set_Division.Column " _
& "WHERE PrimaryKey = " & lstRiskView & ""
Set rst = New ADODB.recordset
rst.Open strSql, cnn, adOpenStatic, adLockOptimistic, adCmdText
If rst.EOF Then
MsgBox "No Record(s) found"
If IsNull(rst("PROCF")) = False Then
MsgBox "PROCF is not null"
txtProcCodeF = rst("PROCF")
txtProcCodeF > 0 And txtProcCodeF < 99999
rst("PROCF") is in a text format in the table
The problem is that in the else statement access does not like > 0. I get the error:
It works if I a put an = sign but not when I use the > sign. I am at a loss since I know I have been able to do this before