G
Guest
Hi
I’m trying to set a record set to my variables. In doing so I get an error
when there is a null value in the table. I’m trying to catch the null values
with the if then statement with no luck. Here is some of my code:
Dim strNewBankerName As String
Dim strSQL As String
Dim rst As Recordset
Dim dbs As Database
Set dbs = CurrentDb
strSQL = "SELECT Relationship_ID, Banker_ID, NewBankerID,
NewBankerIntranetID, NewBankerName FROM BankerReassignmentList;"
Set rst = dbs.OpenRecordset(strSQL)
rst.MoveFirst
If rst("NewBankerName") = Null Then
MsgBox "rst('NewBankerName') is Null"
Else
strNewBankerName = rst("NewBankerName")
End If
What can I do to catch the Null?
Thanks in advance,
Mark
I’m trying to set a record set to my variables. In doing so I get an error
when there is a null value in the table. I’m trying to catch the null values
with the if then statement with no luck. Here is some of my code:
Dim strNewBankerName As String
Dim strSQL As String
Dim rst As Recordset
Dim dbs As Database
Set dbs = CurrentDb
strSQL = "SELECT Relationship_ID, Banker_ID, NewBankerID,
NewBankerIntranetID, NewBankerName FROM BankerReassignmentList;"
Set rst = dbs.OpenRecordset(strSQL)
rst.MoveFirst
If rst("NewBankerName") = Null Then
MsgBox "rst('NewBankerName') is Null"
Else
strNewBankerName = rst("NewBankerName")
End If
What can I do to catch the Null?
Thanks in advance,
Mark