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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top