Eikenhorst
Registered User.
- Local time
- Today, 05:18
- Joined
- Mar 9, 2007
- Messages
- 25
Hello,
I have a problem with VBA. I have a form with a lot of textboxes. I only want to display the amount of textboxes as divined in a table. So if the value in the table is 4, I only want it to show the first 4 values, but if it is 99 then I want it to show the first 99 textboxes.
Since I don’t want to work with a huge amount of If statements I would like to work with some sort of flexible naming. Those textboxes are named Text1 to Text100 So I made the following Code:
Dim CurrNumber As Byte
CurrNumber = 1
Do Until CurrNumber = rst![Value1] + 1
Me.Text[CurrNumber].Visible = True
CurrNumber = CurrNumber + 1
Loop
But I don’t know how I should get the “Me.Text[CurrNumber].Visible = True” line right. Could someone please help me a hand with this one? Any help is greatly appreciated! Thanks!
I have a problem with VBA. I have a form with a lot of textboxes. I only want to display the amount of textboxes as divined in a table. So if the value in the table is 4, I only want it to show the first 4 values, but if it is 99 then I want it to show the first 99 textboxes.
Since I don’t want to work with a huge amount of If statements I would like to work with some sort of flexible naming. Those textboxes are named Text1 to Text100 So I made the following Code:
Dim CurrNumber As Byte
CurrNumber = 1
Do Until CurrNumber = rst![Value1] + 1
Me.Text[CurrNumber].Visible = True
CurrNumber = CurrNumber + 1
Loop
But I don’t know how I should get the “Me.Text[CurrNumber].Visible = True” line right. Could someone please help me a hand with this one? Any help is greatly appreciated! Thanks!