Hi,
In a form I have 10 text boxes (TextBox1 - TextBox10), which are set to invisible.
With a loop I want to change the "Visible" property of the first X text boxes.
e.g.
X = 5
Dim BoxName As String
Dim i as Integer
i = 1
Do Until i = X
BoxName = "TextBox" & i
i = i + 1
Me.BoxName.Visible = True
Loop
I keep getting the error message that "BoxName" in the "Me.BoxName..." line is not a method or data member. So my question is: How do I tell Access that by BoxName I actually mean the value of the variable (TextBox1 - TextBoxX)? Or is my idea of doing this totally wrong? Can anyone help me?
Thanks in advance
Luke
In a form I have 10 text boxes (TextBox1 - TextBox10), which are set to invisible.
With a loop I want to change the "Visible" property of the first X text boxes.
e.g.
X = 5
Dim BoxName As String
Dim i as Integer
i = 1
Do Until i = X
BoxName = "TextBox" & i
i = i + 1
Me.BoxName.Visible = True
Loop
I keep getting the error message that "BoxName" in the "Me.BoxName..." line is not a method or data member. So my question is: How do I tell Access that by BoxName I actually mean the value of the variable (TextBox1 - TextBoxX)? Or is my idea of doing this totally wrong? Can anyone help me?
Thanks in advance
Luke
Last edited: