UnsolvedCoding
Technical User
Hey all -
I am working in Excel and am trying to get a simple indicator to work and am having a brain fry. All I want is to be able to determine if the Status_CD is P and based on that make a decision. For the life of me can't remember how.
' SQL Code
sSQL = "Select 1 from ER_CB where STATUS_CD = 'P' and CB_NBR ='" & sCurrCBNbr & "' "
' Connect to SQL
SQL_Connection
If Warning_Flag = 1 Then Exit Sub
' Create Record set
Recordset_Connection
If Warning_Flag = 1 Then Exit Sub
If rsERDB("STATUS_CD") <> "P" Then Cells(i, "L").Value = "Not Pending"
I have tried While Not rsERDB.EOF and While rsERDB.EOF, put in a cell value as listed above, using a msgbox, changed SQL etc but am simply stuck.
Anyone know what I am missing? I know its simple but it escapes me at the moment.
I am working in Excel and am trying to get a simple indicator to work and am having a brain fry. All I want is to be able to determine if the Status_CD is P and based on that make a decision. For the life of me can't remember how.
' SQL Code
sSQL = "Select 1 from ER_CB where STATUS_CD = 'P' and CB_NBR ='" & sCurrCBNbr & "' "
' Connect to SQL
SQL_Connection
If Warning_Flag = 1 Then Exit Sub
' Create Record set
Recordset_Connection
If Warning_Flag = 1 Then Exit Sub
If rsERDB("STATUS_CD") <> "P" Then Cells(i, "L").Value = "Not Pending"
I have tried While Not rsERDB.EOF and While rsERDB.EOF, put in a cell value as listed above, using a msgbox, changed SQL etc but am simply stuck.
Anyone know what I am missing? I know its simple but it escapes me at the moment.