murray83
Games Collector
- Local time
- Today, 15:39
- Joined
- Mar 31, 2017
- Messages
- 843
so i have a form where peopels holidays they have reuested, are then approved by managment, which then in turn updates one table as shown below in the code
But what i also want to do is update the main rota table called (tblRota) so for the dates in question it changes the shift record (Shift) to H ( for Holiday ) so when viewing the rota it would show that that person is on holiday, but the bit i cant get my head around which i am guessing will have steep curve for me to learn, is this.
how do i get the dates in the middle of the holiday as i'm just capturing the start and end date as see in image below, all help much appreciated
Code:
Private Sub cmdUpdate_Click()
'removes the msg box asking are you sure you want to update the record
DoCmd.SetWarnings False
'updates the record in main table to say its been aproved and by whom and when
If Me.Approved.Value = " " Then
DoCmd.RunSQL ("Update tblRequestedDates set [Approved] = cmbAproved.Value , [ApprovedBy] = cmbAprovedBy.value, [DtApproved] = DtApproved.Value where [ID]= ID.value ")
DoCmd.OpenReport "HolidayFormApproved", acViewPreview 'print out a new holiday form with Approvers signature on
Else
MsgBox "You can only Approve Holidays which havent yet been approved"
End If
'sql to update rota to add H to the days of holiday
'DoCmd.RunSQL
Me.Refresh
'warnings back on
DoCmd.SetWarnings True
End Sub
But what i also want to do is update the main rota table called (tblRota) so for the dates in question it changes the shift record (Shift) to H ( for Holiday ) so when viewing the rota it would show that that person is on holiday, but the bit i cant get my head around which i am guessing will have steep curve for me to learn, is this.
how do i get the dates in the middle of the holiday as i'm just capturing the start and end date as see in image below, all help much appreciated