Command Buttons

C

Chris

Morning all,

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

Jeff Boyce

Chris

(your syntax may vary):

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

Douglas J. Steele

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
 
E

Ed Robichaud

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
 
Top