Ok, I have 20 labels defined on my form and the text for these labels are being blanked out when the form loads. Labels are named “LabelValue1…LabelValue20”
On the form, is a textbox where a user will enter a numeric value. Upon hitting submit, I need to populate the first available label with this numeric value. The user may enter up to 20 different values at one time and I need to populate the next label with what ever value they entered a second time and so fourth.
Is there an easier way to code this then using a huge long if else endif statement?
While a list box would be more appropriate, if you need to do so, you can access the labels by name using the form’s
Controlscollection:To use a
ListBoxcontrol, instead, you would simply need to do something like this:And then to read a particular item, you would do something like this: