donkey9972
Registered User.
- Local time
- Yesterday, 21:14
- Joined
- May 18, 2008
- Messages
- 193
Hi, I have been scouring the internet and I can't find a solution to my issue. I have 10 text boxes on a form. The main one (TB1) will be a number between 1 to 9 and also null. What I am trying to do is have the other 9 boxes disabled if TB1 is null, and if there is lets say a 5 in TB1 then only the first 5 boxes are enabled the other 4 are disabled. I am trying to avoid using numerous lines of code like this:
And then another set of code like that if there is a 2 entered, then 3, etc.... there has to be a better way, I just have no idea how to accomplish it. But if there isn't, then I guess I would have no choice but to do it that way, but I am hoping there is a better way.
Code:
If Me.TB1.Value = 1 Then
Me.BT2.Enable = False
Me.BT3.Enable = False
Me.BT4.Enable = False
Me.BT5.Enable = False
Me.BT6.Enable = False
Me.BT7.Enable = False
Me.BT8.Enable = False
Me.BT9.Enabled = False
Me.BT10.Enabled = False
And then another set of code like that if there is a 2 entered, then 3, etc.... there has to be a better way, I just have no idea how to accomplish it. But if there isn't, then I guess I would have no choice but to do it that way, but I am hoping there is a better way.