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
|
|
0
|
|
|
|
Reply
|
Song
|
3/23/2010 12:12:31 AM |
|
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" <song.usa@gmail.com> wrote in message
news:53b5d966-cfe7-4c8b-98da-090b572fe018@k6g2000prg.googlegroups.com...
> 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
|
|
0
|
|
|
|
Reply
|
Jeanette
|
3/23/2010 2:05:49 AM
|
|
On Mar 22, 7:05=A0pm, "Jeanette Cunningham"
<n...@discussions.microsoft.com> wrote:
> Something like this in the button's click event.
>
> With Me.cmdBtnName
> =A0 =A0 If .Caption =3D "Check All" Then
> =A0 =A0 =A0 =A0 .Caption =3D "Check None"
> =A0 =A0 ElseIf .Caption =3D "Check None" Then
> =A0 =A0 =A0 =A0 .Caption =3D "Check All"
> =A0 =A0 End If
> End With
>
> Note: replace cmdBtnName with the name for your button.
>
> Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
>
> "Song" <song....@gmail.com> wrote in message
>
> news:53b5d966-cfe7-4c8b-98da-090b572fe018@k6g2000prg.googlegroups.com...
>
>
>
> > 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.
|
|
0
|
|
|
|
Reply
|
Song
|
3/23/2010 1:15:46 PM
|
|
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" <nnn@discussions.microsoft.com> wrote in message
news:eH5%23i3iyKHA.244@TK2MSFTNGP06.phx.gbl...
> 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" <song.usa@gmail.com> wrote in message
> news:53b5d966-cfe7-4c8b-98da-090b572fe018@k6g2000prg.googlegroups.com...
>> 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
>
>
|
|
0
|
|
|
|
Reply
|
Jon
|
3/23/2010 1:49:06 PM
|
|
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" <song.usa@gmail.com> wrote in message
news:c7cfe994-892c-450d-8501-20f537965d40@p3g2000pra.googlegroups.com...
On Mar 22, 7:05 pm, "Jeanette Cunningham"
<n...@discussions.microsoft.com> 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" <song....@gmail.com> wrote in message
>
> news:53b5d966-cfe7-4c8b-98da-090b572fe018@k6g2000prg.googlegroups.com...
>
>
>
> > 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.
|
|
0
|
|
|
|
Reply
|
Jeanette
|
3/24/2010 9:54:52 AM
|
|
|
4 Replies
966 Views
(page loaded in 0.066 seconds)
Similiar Articles: Change button caption on each click - microsoft.public.access ...How to change button caption from "Check All" to "Check None" when clicked, and change back when click again (toggle)? Because of space limitation, ... Change lblHeading.Caption of report based on which form's button ...Change button caption on each click - microsoft.public.access ... Change lblHeading.Caption of report based on which form's ... I have 2 separate forms. dynamically change sub form (using code) on button click ...... temporarily - Event On Click - microsoft ..... will not change your code so that the click event will still look like: Public Sub ... Change button caption on each click ... editing caption numbering separator Word 2007 - microsoft.public ...Grateful to you both. I continue to be ... > > In W2007, to change the numbering in captions, go to insert caption; click > the numbering button; and make your changes. Spcecial character for Command Button's Caption - microsoft ...programtically change an Embedded picture of a command button ... Change button caption on each click ... execute will look for a special value embedded within the command ... Why does one have to click on the cmd button twice - microsoft ...My userform contains one Textbox ... has to press the same spin button twice just to change the focus. Does ... Change button caption on each click - microsoft.public ... programtically change an Embedded picture of a command button ...command button caption does not display - microsoft.public.access ... Command Button Pictures Taken from Command Bar Button ... Change button caption on each click ... Changing label caption temporarily - Event On Click - microsoft ...Changing label caption temporarily - Event On Click ... For example, in your case you have a form that ... ... element. ... bdo>, <big>, <blockquote>, <body>, <button>, <caption ... Change Caption in Report - microsoft.public.access.reports ...However, I would like to change the caption ... Button on each form opens a report. One ... Changing label caption temporarily - Event On Click - microsoft ... How get caption of textbox label in OnClick event? - microsoft ...Changing label caption temporarily - Event On Click - microsoft ... How get caption of textbox label in ... ... Catch click event button - microsoft.public.word.docmanagement Answer : Change button caption on each clickChange button caption on each click - answer - How to change button caption from "Check All" to "Check None" when clicked, and change back when click again (toggle)? Change button caption on each click - microsoft.public.access ...How to change button caption from "Check All" to "Check None" when clicked, and change back when click again (toggle)? Because of space limitation, ... Change button caption on each click - PC Review - Computer News ...How to change button caption from "Check All" to "Check None" when clicked, and change back when click again (toggle)? Because of Change the caption on button when clicked - GIDForumsChange the caption on button when clicked ... is called each ... window after changing the captions? that means when the captions on the button changes to stop image, i click ... Microsoft Access: Change button caption on click... - database ...database.itags.org: Microsoft Access question: Change button caption on click ... list all records in therecordset (just the name of each record). I would like to change ... 7/24/2012 2:00:34 AM
|