Try this: (it works fine for me)
Start a new project.
Add two command buttons. (Let the name Command1 and Command2)
Add this code to command2_click
Run the project and enjoy the code!Code:Dim Text As String Text = "Command1" Form1.Controls(text).BackColor = vbYellow





Reply With Quote