Hi guys
To simplify my problem, imagine I have a bunch of textboxes on a form, all named textbox_A, textbox_B etc. To save having to type 26 lines of code, I decided to create a for loop instead, using the code beneath to set the value in each textbox to the corresponding letter. The current code is my latest attempt, but I have tried many variations including with and without delimiters, dots instead of bangs etc.
Code:
Dim loopLetter As String
Dim loopInteger As Integer
For loopInteger = 65 To 90
loopLetter = "'textbox_" & Chr(loopInteger) & "'"
[Forms]![Results]![loopLetter] = loopLetter
Next loopInteger
How do I go about referencing the textbox using the variable from the loop?
Thank you