Even thinking of the title for this question was difficult for me. When it comes to code I'm a rank amateur. Just ask vbaInet
Here's what I would like to do:
I have a data entry form [Resources] and I would like to display some information about holidays in the form footer. Once the user has picked a combination of Trainer_Name and Start_Date I would like the 'On Change' or 'On lost Focus' event (not sure which would be the best) to perform a datediff calculation.
The datediff calculation would compare the difference between the start date entered on the form and the most recent past Start_Date on a query called [Hours Holiday_P1].
If someone could help me do this then I could adapt the same code to also look for the difference between the End_Date on the form and the next Start_Date on the Query.
The idea is that when resourcing trainers I know how long it is since and how long it is till their next holiday.
I've included a couple of images that might help
The sql for the query is
As always any help is really appreciated.
Thanks Guinnes
Here's what I would like to do:
I have a data entry form [Resources] and I would like to display some information about holidays in the form footer. Once the user has picked a combination of Trainer_Name and Start_Date I would like the 'On Change' or 'On lost Focus' event (not sure which would be the best) to perform a datediff calculation.
The datediff calculation would compare the difference between the start date entered on the form and the most recent past Start_Date on a query called [Hours Holiday_P1].
If someone could help me do this then I could adapt the same code to also look for the difference between the End_Date on the form and the next Start_Date on the Query.
The idea is that when resourcing trainers I know how long it is since and how long it is till their next holiday.
I've included a couple of images that might help
The sql for the query is
Code:
SELECT Resourcing.Start_Date, Resourcing.Trainer_Name, Resourcing.Duration, Time.Hours, [Hours]/7.4 AS Days
FROM (Resourcing INNER JOIN Employees ON Resourcing.Trainer_Name = Employees.Trainer_Name) INNER JOIN [Time] ON Resourcing.Duration = Time.Time
WHERE (((Resourcing.Start_Date) Between DateSerial(Year(Date())-IIf(Month(Date())<4,1,0),4,1) And DateSerial(Year(Date())+IIf(Month(Date())>3,1,0),3,31)) AND ((Resourcing.Activity) Like "Holiday*"))
ORDER BY Resourcing.Start_Date;
Thanks Guinnes
Last edited: