Reputation: 1
greetings for all access experts in this forum
I got problems when trying to concat between my text box name with string.
In my form there are 10 textboxs named : Student1, Student2, Student3...Student10
I tried to get value from each textbox
This is my code :
Dim a as string
a = 1
do until a = 2
MsgBox (Me.Controls("Student"&a).Value)
loop
It's not working. No error also.
Any help would be appreciated.
Many thanks.
Upvotes: 0
Views: 1189
Reputation: 123419
Try something more like this:
Dim i As Integer
For i = 1 To 3
MsgBox Nz(Me.Controls("Student" & i).Value, "")
Next
Upvotes: 1