- VBA Help – "_AfterUpdate" event for mulitple controls on Access form
I’ve got an Access Form with about 10 text boxes containing numbers that add up to a total value held in an 11th text box. I then need to check the value in textbox11 to make sure it doesnt exceed another value (held in box 12).
I’ve attached code to each of the 10 text boxes to update the total in 11, but there must have been an easier way than this:
Private Sub txtInitialDrop1_Vol_AfterUpdate()
Private Sub txtInitialDrop2_Vol_AfterUpdate()
Private Sub txtInitialDrop3_Vol_AfterUpdate()
Private Sub txtInitialDrop4_Vol_AfterUpdate()
Is there a way I can use just one _AfterUpdate event, by referencing all 10 text boxes as some sort of Collection maybe?
cheersPosted 4 years agoSprocketJockeyMember
I’m not sure there is a way around having an update event on each textbox but an alternative to your approach you could call your code to run on the form’s afterupdate event rather than that of the individual text boxes and then simply put a me.refresh in the afterupdate event of the individual text boxes.
Only real advantage of this over what you’re doing already though is that you only need to maintain the reference to your total check in one place rather than 10.Posted 4 years ago
The topic ‘VBA Help – "_AfterUpdate" event for mulitple controls on Access form’ is closed to new replies.