twgonder
Member
- Local time
- Yesterday, 23:59
- Joined
- Jul 27, 2022
- Messages
- 178
Newbie (again) to Access VBA and I am working on my template for forms.
Since I don't want to repeat code in each class module, I try to move as much common code to a general purpose "form module".
This often causes me headaches, not knowing exactly/properly what to pass to the generalized form module so that things can work.
In any case, what I'm trying to do now is call a form module procedure (from the class procedure) to cycle through all the controls on the form and change the background color of certain text boxes to alternating colors (yellow not available for change and green for okay). Any control that I want to change has a prefix of "tbxm_" (text box modifiable). I've got the color code part figured out. I just need the loop through controls portion and what to pass from the form class procedure to get the loop part to work for the active form.
Can someone please provide a brief code example of the proper way to do this?
Thanks
Since I don't want to repeat code in each class module, I try to move as much common code to a general purpose "form module".
This often causes me headaches, not knowing exactly/properly what to pass to the generalized form module so that things can work.
In any case, what I'm trying to do now is call a form module procedure (from the class procedure) to cycle through all the controls on the form and change the background color of certain text boxes to alternating colors (yellow not available for change and green for okay). Any control that I want to change has a prefix of "tbxm_" (text box modifiable). I've got the color code part figured out. I just need the loop through controls portion and what to pass from the form class procedure to get the loop part to work for the active form.
Can someone please provide a brief code example of the proper way to do this?
Thanks