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