I am quite new to VB coding but I do understand some of the basics. I want to create a loop that checks the value within 8 text boxes and enabled a tick box next to the respected text box if it not blank. I am not quite sure on the syntax. I have 8 text boxes called Textbox1 : Textbox8 and 8 checkboxes with names checkbox1-8. This is the code I have already but I just need a bit of help with the syntax.
For i = 1 To 8 If Textbox(i) = "" Then
checkbox(i).enabled = false
else checkbox(i).enabled = true
End If
Next
I could just run 8 if statements and it does work but I know there must be a cleaner way with less lines of code.
For i = 1 To 8 If Textbox(i) = "" Then
checkbox(i).enabled = false
else checkbox(i).enabled = true
End If
Next
I could just run 8 if statements and it does work but I know there must be a cleaner way with less lines of code.
Last edited: