kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Hello All,
I have this challenge here: i wanna find out if what i am thinking is possible. Then after that i need help with it.
So i have a textbox called txtCurrentUser and in this textbox i have username in it. Now i wanna write a script to look at the txtCurrentUser, counting from the left to right, match the third character to another textbox's value(txtOption). If value is not the same, then disable all textboxes from Rw2 to Rw23 (these are the names of textboxes i wanna disable if names didnt match). The value in txtCurrentUser could be as:
M1Afighter
M2Bswimmer
M3Csinger
M4Dpainter
M5 fisher
But when the values are the same, then i will like to disable all but two textboxes. Say i have the username: M5 fisher then in txtOption there is blank, then disable all except two say Rw6 and Rw16. Else disable all of them.
So the A, B, C, D or Blank is what i am talking about as the third character in the txtCurrentUser. Thanks and i hope this is very clear.
Kelly
Ps.
All these controls are on a userform
I have this challenge here: i wanna find out if what i am thinking is possible. Then after that i need help with it.
So i have a textbox called txtCurrentUser and in this textbox i have username in it. Now i wanna write a script to look at the txtCurrentUser, counting from the left to right, match the third character to another textbox's value(txtOption). If value is not the same, then disable all textboxes from Rw2 to Rw23 (these are the names of textboxes i wanna disable if names didnt match). The value in txtCurrentUser could be as:
M1Afighter
M2Bswimmer
M3Csinger
M4Dpainter
M5 fisher
But when the values are the same, then i will like to disable all but two textboxes. Say i have the username: M5 fisher then in txtOption there is blank, then disable all except two say Rw6 and Rw16. Else disable all of them.
So the A, B, C, D or Blank is what i am talking about as the third character in the txtCurrentUser. Thanks and i hope this is very clear.
Kelly
Ps.
All these controls are on a userform