How can I loop through 124 textboxes on a VBA form in MS Access, and have the values of these boxes sum up within a textbox called txtSum?
Posted on 2006-07-20
I have a VBA form that interacts with an MS Access dBase.
On my form I have 124 textboxes named q1 through q124. I also have a textbox called 'txtSum'. How can I loop through these 124 textboxes and have their values sum up within the textbox called txtSum?
I have seen other answers on EE that address this, but I am having a bit of difficulty getting one that works…. so, I am posting a request that is specific and unique to my situation. I am aware that control arrays are not available in VBA (aarrgh!), but some posts talk about 'simulating' a control array. Can someone please assist me in creating this solution?.... it would help me incredibly. I am pretty good with VB6, VB.net, Asp.Net, but getting around this VBA control array limitation is frustrating. I am tired of writing lengthy 'linear' code over and over in VBA as a workaround.
I am a fairly decent programmer, but many thanks to those of you who really are 'experts'.... I couldn't learn without you guys....