Hi all,
I have been playing around with userforms and had a design question. Currently I have a userform which the user populates with ten different items per line of stock. They then click a button to add another line and in doing so adds ten textboxes for the next line of stock. The problem is I have code behind each text box which though automatically gets written (and works) I'm worried that the code will get too big if the user adds in say 100 lines (therefore there would be 1000 text boxes generated, each with "onexit" code written in a loop (basically the entered information gets stored on a sheet and then other fields get triggered to update with formula)
Am I asking for trouble taking this approach? The user wants to see the updates as they type into the userform so want to avoid a "refresh" button approach. Is there a way of saying on any field exit in the userform, loop through all the controls and write to sheet/default values as per the code? I read about class modules put it seems they only work on change events and I don't want code being triggered on each key stroke, only when they have finished inputting for that field (though Id have to see how slow that would be taking that approach).
I will hasten to add it is unlikely that there will be more than 20 lines/200 boxes per user form, but the code generated behind that would still be quite large and go over the module size.
Any suggestions welcome.