If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Change button caption on each click
How to change button caption from "Check All" to "Check None" when
clicked, and change back when click again (toggle)? Because of space limitation, I don't want to create 2 separate buttons. When click Check All, I update the field to -1 When click Check None, I update the field to 0 Thanks |
#2
|
|||
|
|||
Change button caption on each click
Something like this in the button's click event.
With Me.cmdBtnName If .Caption = "Check All" Then .Caption = "Check None" ElseIf .Caption = "Check None" Then .Caption = "Check All" End If End With Note: replace cmdBtnName with the name for your button. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Song" wrote in message ... How to change button caption from "Check All" to "Check None" when clicked, and change back when click again (toggle)? Because of space limitation, I don't want to create 2 separate buttons. When click Check All, I update the field to -1 When click Check None, I update the field to 0 Thanks |
#3
|
|||
|
|||
Change button caption on each click
On Mar 22, 7:05*pm, "Jeanette Cunningham"
wrote: Something like this in the button's click event. With Me.cmdBtnName * * If .Caption = "Check All" Then * * * * .Caption = "Check None" * * ElseIf .Caption = "Check None" Then * * * * .Caption = "Check All" * * End If End With Note: replace cmdBtnName with the name for your button. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Song" wrote in message ... How to change button caption from "Check All" to "Check None" when clicked, and change back when click again (toggle)? Because of space limitation, I don't want to create 2 separate buttons. When click Check All, I update the field to -1 When click Check None, I update the field to 0 Thanks- Hide quoted text - - Show quoted text - Thank you, Jeanette. Under what event should I put the code? After each click, I use docmd.runsql to replace all. |
#4
|
|||
|
|||
Change button caption on each click
Or (assuming the field is Boolean):
Private Sub cmdBtnName_Click() field = Not field cmdBtnName.Caption = Switch(field, "Check None", Not field, "Check All") End Sub Jon "Jeanette Cunningham" wrote in message ... Something like this in the button's click event. With Me.cmdBtnName If .Caption = "Check All" Then .Caption = "Check None" ElseIf .Caption = "Check None" Then .Caption = "Check All" End If End With Note: replace cmdBtnName with the name for your button. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Song" wrote in message ... How to change button caption from "Check All" to "Check None" when clicked, and change back when click again (toggle)? Because of space limitation, I don't want to create 2 separate buttons. When click Check All, I update the field to -1 When click Check None, I update the field to 0 Thanks |
#5
|
|||
|
|||
Change button caption on each click
As I mentioned in the last post, put the code in the on click event for the
button that runs that query. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Song" wrote in message ... On Mar 22, 7:05 pm, "Jeanette Cunningham" wrote: Something like this in the button's click event. With Me.cmdBtnName If .Caption = "Check All" Then .Caption = "Check None" ElseIf .Caption = "Check None" Then .Caption = "Check All" End If End With Note: replace cmdBtnName with the name for your button. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Song" wrote in message ... How to change button caption from "Check All" to "Check None" when clicked, and change back when click again (toggle)? Because of space limitation, I don't want to create 2 separate buttons. When click Check All, I update the field to -1 When click Check None, I update the field to 0 Thanks- Hide quoted text - - Show quoted text - Thank you, Jeanette. Under what event should I put the code? After each click, I use docmd.runsql to replace all. |
Thread Tools | |
Display Modes | |
|
|