I have a function that gets the number of Textbox. I need to use this number in object's name.
Private Function func(ByVal number As Integer)
If Val(TextBox[number].Text) > 300 Then
TextBox[number].Text = 300
End If
End Function
E.g. if number is 5 it should be: TextBox5.Text = 300
Thanks for help!
This function gets you a control given its name:
Then this sub does what you want, but it will fail it you dont really have some textbox called TextBoxN, where N is the number you provide