Private Sub BaselineScheduleDate_BeforeUpdate(Cancel As Integer)
Dim pIDWeek As Integer
Dim intSched1 As Integer
pIDWeek = Weekday(BaselineScheduleDate)
If pIDWeek = 1 Or pIDWeek = 7 Or pIDWeek = 6 Then '1=sunday, 6=friday, 7=saturday'
MsgBox "Participant's scheduled date can't be on Friday or weekend"
Cancel = True 'Set to true to abort update'
me.undo
exit sub
End If
intSched1 = Nz(DLookup("[SumOfDateCount]", "Qry1BaselineSum"), 0)
If intSched1 > 3 Then
MsgBox "There are already " & intSched1 & " participants scheduled for this date!", vbOKOnly, "Cant Schedule"
cancel = true
me.undo
Else
If IsNull(Me.BaselineScheduleDate) Then
'something missing
Else
MsgBox "There are " & intSched1 & " Participant scheduled for this date!", vbOKOnly, "Ok To Schedule"
End If
End If
End Sub