View Single Post
Old Aug 31st, 2006, 11:04 AM   #8
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Try substrings...

If usrName.Substring(0, 4).ToUpper = "BUT_" Then
    Me.uiButRestButton3.Visible = True
    ...

Substring(STARTING POSITION, NUM OF CHARS TO RETURN)
All strings start at 0, so for the %CON_% instance, you will need to determine where in the string CON_ starts...

For instance: USCON_MYID
usrName.Substring(2, 4).ToUpper = "CON_"

If the position of the keyword is not always constant in the username string, you could take the high road and use the .IndexOf string property to determine if the keyword is in that string... anywhere.

Another thing is... are you sure you want to disable the view property or just disable the ability to click the button? button.Visible = False vs button.Enabled = False
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote