Hi all
I hope one of you great people can help me with this. I searched this forum and google for days now, without finding a helpfull sollution.
The situation:
I have a main form where I have 3 sections. The form itself, a listbox and a subform (continuous form).
The form displays the data of a intervention, like date, begin hour (intHRStart) and end hour (intHRStop).
When I select firefighters from the listbox (multiple select) and verify with a command button, these people are stored in a different table. It also copies the begin and end hour to this table. This table (tblFF) is showed in the subform.
Because the firefighters work in diffrent shifts, this has to be filled in on the form. With a after update I call a function wich will calculate if the firefighter has worked in his shift or not. It also calculates how many minutes he has worked in or out of his shift, and rounds it to 15min parts ...
The problem
All this code works perfect. But I need two other things:
- When you verify the people, it have to run the mentioned code for each firefighter.
- When you change the data in the main form, tblFF is updated with the new data. but it have to calculate the worked hours again.
So to put is simply, I need a manner to run a function (code) for each record in this subform.
I hope someone can help me with this, I'm starting to pull out my hairs from frustration!
Thank you in advance
Kurt
I hope one of you great people can help me with this. I searched this forum and google for days now, without finding a helpfull sollution.
The situation:
I have a main form where I have 3 sections. The form itself, a listbox and a subform (continuous form).
The form displays the data of a intervention, like date, begin hour (intHRStart) and end hour (intHRStop).
When I select firefighters from the listbox (multiple select) and verify with a command button, these people are stored in a different table. It also copies the begin and end hour to this table. This table (tblFF) is showed in the subform.
Because the firefighters work in diffrent shifts, this has to be filled in on the form. With a after update I call a function wich will calculate if the firefighter has worked in his shift or not. It also calculates how many minutes he has worked in or out of his shift, and rounds it to 15min parts ...
The problem
All this code works perfect. But I need two other things:
- When you verify the people, it have to run the mentioned code for each firefighter.
- When you change the data in the main form, tblFF is updated with the new data. but it have to calculate the worked hours again.
So to put is simply, I need a manner to run a function (code) for each record in this subform.
I hope someone can help me with this, I'm starting to pull out my hairs from frustration!
Thank you in advance
Kurt