Command Buttons

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Morning all,

Simple question today. When you click a command button can you change the
caption on the button.
 
Chris

(your syntax may vary):

Me!cmdYourCommandButton.Caption = "Your new caption"
 
Sure

Private Sub Command0_Click()
If Me.Command0.Caption = "Changed from" Then
Me.Command0.Caption = "Changed to"
Else
Me.Command0.Caption = "Changed from"
End If
End Sub
 
Not sure, but the KeyDown event might work. The more common solution is to
have two command buttons (stacked on top of each other). Set the top one to
transparent or not visible, then change that property with the OnClick event
of the bottom one.
-Ed
 
Back
Top