-
Checking for Null
Even when rst!employee_id is null the code doesn't run through the msgbox and the exit sub statement. Any suggestions are appreciated.
If rst!EMPLOYEE_ID = Null Then
MsgBox rst!Name & " is currently assigned to " & rst!POS & ". " & rst!Name & " needs to be removed from this mpcn before this action can continue.", vbCritical + vbOKOnly
Exit Sub
End If
-
If IsNull(rst("ID")) then
'---- blah
End If
Vince
-
Hi
If you use a access-mdb then don't forget to set the option "Null-values allowed" to yes for the respictive data-fields.
In the program you can avoid the problem by connecting the field via:
txtField = "" & rs.fields("name")
for example ....
Franky
-
IsNull function looks better ;)
...and if you are in access, have a look at the Nz function...
Vince