Message based on Enrollment

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that is a class roster. As people call to register their name
on the roster I want to track the department number. I want to only allow a
limited number of employees (say 4) from department number 6330 in each class.

I have a Max Department Enroll field with a value of 4

I want to count the number of employees from dept 6330, if count is greater
than or equal to 4 I want a message to display that "Class is Full for this
department"

Here is the 2 lines of code that I have but I am getting nothing:
=IIf(([DEPT#])=6330,(Count([dept#])),'''')
=IIf(([MaxDeptEnroll])<=(Count([dept#])),"Class full for dept 6330!!!!","")

any help would be appreciated.

JZ
 
If DCount("[dept#]","tblRegistrations","[dept#] = '" & Me.txtDept & "'") _
Me.MaxDeptEnroll Then
MsgBox "Class full for dept " & Me.txtDept"
End If
 
Back
Top