Is there a way to iterate through each record in a form and run a module?
I thought about using an update query but I think what I'm trying to do is too complicated.
To explain what I'm trying to do, I'm making calculation of a dollar amount times a percentage increase for each record in a form when the user clicks a button on the form. The user can select if they want to use the default increases of enter their own custom ones. The default increases are maintained in another table with another form. If the user wants to change those defaults, they can go into the default form and do that and I have a save button on there. When they click the save button I want it to automatically go through all the records in that other table and update them with the new percentages.
It's not quite as easy at it sounds. What I do is I copy the previous month's dollar value into the current month, and then at a renewal date I need to apply the first increase. Then copy that new value into the rest of the months. Someitmes there can be two renewal dates and I have a second renewal increase value that I use at that.
Either way, I have all that code written for when the user calculates the code from the Group form. The problem is that when they go change the defaults, the value's are already calculated with the old defaults and they don't update. I want them to recalculate based on the new default increases. That's why I was thinking of putting that code I have already written to do the calculations into a module, then when the defaults are updated and save is clicked I can loop through each record and run that module. Any help is appreciated. Thanks.
I thought about using an update query but I think what I'm trying to do is too complicated.
To explain what I'm trying to do, I'm making calculation of a dollar amount times a percentage increase for each record in a form when the user clicks a button on the form. The user can select if they want to use the default increases of enter their own custom ones. The default increases are maintained in another table with another form. If the user wants to change those defaults, they can go into the default form and do that and I have a save button on there. When they click the save button I want it to automatically go through all the records in that other table and update them with the new percentages.
It's not quite as easy at it sounds. What I do is I copy the previous month's dollar value into the current month, and then at a renewal date I need to apply the first increase. Then copy that new value into the rest of the months. Someitmes there can be two renewal dates and I have a second renewal increase value that I use at that.
Either way, I have all that code written for when the user calculates the code from the Group form. The problem is that when they go change the defaults, the value's are already calculated with the old defaults and they don't update. I want them to recalculate based on the new default increases. That's why I was thinking of putting that code I have already written to do the calculations into a module, then when the defaults are updated and save is clicked I can loop through each record and run that module. Any help is appreciated. Thanks.