|
-
Apr 16th, 2002, 09:37 AM
#1
Thread Starter
New Member
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
-
Apr 16th, 2002, 09:42 AM
#2
If IsNull(rst("ID")) then
'---- blah
End If
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Apr 16th, 2002, 10:18 AM
#3
Fanatic Member
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
-
Apr 17th, 2002, 04:37 AM
#4
IsNull function looks better 
...and if you are in access, have a look at the Nz function...
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|