I have 6 checkboxes on a form with all of them have the same name except a number at the end. Example chkBr1, chkBr2, chkBr3 etc... ChkBr6. Based on the number of applicants I have I need to set the visible property to true and set the text to the applicant name. My thought to use the index of the for loop to determine this.
bcnt equeals the number of applicants. (number checkboxes out 6 that are visible.
For i as integer = 1 to bcnt
chkbr[i].visbile = true
chkbr[1].text = applicant 1
next
Error looping / setting control name.
bcnt
doesn't represent "the number of applicants" as a variable name. It represents a cryptic set of four letters. However,Dim numberOfApplicants As....
does clearly indicate intent of the variable. Don't be afraid to use long variable names when they are concise. Embrace them.