R
Rodney
Could someone please help me with this code.
What I want is when the user is creating a roster if they select a trainer
who is on leave during that time the user receives a message.
TrainerID and RosterDate are two controls on this form.
Private Sub RosterDate_AfterUpdate()
If Me.TrainerID = [tblTrainerLeave].[TrainerID] AND
Me.RosterDate >= [tblTrainerLeave].[LeaveStartDate] AND
<=[tblTrainerLeave].[LeaveEndDate] Then
Message Box "This trainer is on leave from
[tblTrainerLeave].[LeaveStartDate] to
[tblTrainerLeave].[LeaveEndDate] please select another trainer"
End If
End Sub
I know the above code is not right but have no idea how to wright it
correctly.
Is this possible to do or am I asking to much
Thank you in advance
Rodney
What I want is when the user is creating a roster if they select a trainer
who is on leave during that time the user receives a message.
TrainerID and RosterDate are two controls on this form.
Private Sub RosterDate_AfterUpdate()
If Me.TrainerID = [tblTrainerLeave].[TrainerID] AND
Me.RosterDate >= [tblTrainerLeave].[LeaveStartDate] AND
<=[tblTrainerLeave].[LeaveEndDate] Then
Message Box "This trainer is on leave from
[tblTrainerLeave].[LeaveStartDate] to
[tblTrainerLeave].[LeaveEndDate] please select another trainer"
End If
End Sub
I know the above code is not right but have no idea how to wright it
correctly.
Is this possible to do or am I asking to much
Thank you in advance
Rodney