Hi,

I would like to change the caption of "ADD COMMOND BUTTON" to "SAVE" when it is pressed at run time.

Could somebody is there to help me in this regard.

Thanks in advance.

Recommended Answers

All 3 Replies

Public Sub Command1_Click()
if command1.caption = "SAVE" Then
command1.caption = "ADD COMMOND BUTTON"
'Put Save commands here
else
Command1.caption ="SAVE"
'put ADD COMMOND BUTTON Commands here
end if
end sub
Public Sub Command1_Click()
if command1.caption = "SAVE" Then
command1.caption = "ADD COMMOND BUTTON"
'Put Save commands here
else
Command1.caption ="SAVE"
'put ADD COMMOND BUTTON Commands here
end if
end sub

------------------------------------------------------------------
Dear Sir,

Thanks for your kind reply. If I press the Save button it should change the caption "save" to "add" and when i again press the button "add" it should change its caption "add" to "save". please help.

Option Explicit

Public Sub Command1_Click()
If Command1.Caption = "SAVE" Then
Command1.Caption = "ADD"
'Put Save commands here
Else
Command1.Caption = "SAVE"
'put ADD COMMOND BUTTON Commands here
End If
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.