G
Guest
I am trying to cancel the action if a user deselects a check box that the
domain count for that specific checkbox (blnAdmin) < 1. There has to be at
least one record with the check box = True. I have played around with this
and can't seem to get it to work. On the error when it highlights the line
yellow it show the "adminX = 0". What am I doing wrong or any better
sugestions?
------------start of code-----------------
Private Sub Admin_BeforeUpdate(Cancel As Integer)
Dim adminX As Integer
adminX = DCount([Admin], "Employee", "Admin = -1") //this line is
yellow
If adminX <= -1 Then
MsgBox "You must have at least 1 adminstrator!"
Cancel = True
End If
End Sub
-------------end of code---------------
domain count for that specific checkbox (blnAdmin) < 1. There has to be at
least one record with the check box = True. I have played around with this
and can't seem to get it to work. On the error when it highlights the line
yellow it show the "adminX = 0". What am I doing wrong or any better
sugestions?
------------start of code-----------------
Private Sub Admin_BeforeUpdate(Cancel As Integer)
Dim adminX As Integer
adminX = DCount([Admin], "Employee", "Admin = -1") //this line is
yellow
If adminX <= -1 Then
MsgBox "You must have at least 1 adminstrator!"
Cancel = True
End If
End Sub
-------------end of code---------------