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
T Martin - 31 Jan 2005 21:11 GMT
If isnull(rst!NewBankerName) = true then
msgbox "rst('NewBankerName') is null
Else
strNewBankerName = rst("NewBankerName")
End if
> 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:
>
[quoted text clipped - 23 lines]
>
> Mark
Mark B - 31 Jan 2005 21:25 GMT
It works, Thanks T Martin
Mark
> If isnull(rst!NewBankerName) = true then
> msgbox "rst('NewBankerName') is null
[quoted text clipped - 35 lines]
> >
> > Mark