G
Guest
I previously posted a question to "Change Toggle Button Caption" and recieved
a good example to make a toggle button (CustomerChkBx) change the caption
from "No"- not pressed in, to "Yes"- pressed in. Code as follows:
Option Compare Database
Public clicked As Boolean
Private Sub CustomerChkBx_Click()
If clicked = True Then
Me.CustomerChkBx.Caption = "No"
clicked = False
Else
Me.CustomerChkBx.Caption = "Yes"
clicked = True
End If
End Sub
I thought it worked fine however, when I go to the next record the toggle
buton retains the label from the previous record. If I press the button in
the caption goes from "No" to "Yes" as it is supposed to and it will change
back and forth each time it's pressed. But, when I got to the next record the
button will read what ever the last state was. So if I press the button it
will read "Yes" and shows that it's pressed in then when I go to the next
record the caption will read "Yes" and the button will not be pressed in. If
I then press the button it will change the caption to "No" and show that it
is pressed. Isn't there a way I can reset it for the next form to "No" so my
form works.
a good example to make a toggle button (CustomerChkBx) change the caption
from "No"- not pressed in, to "Yes"- pressed in. Code as follows:
Option Compare Database
Public clicked As Boolean
Private Sub CustomerChkBx_Click()
If clicked = True Then
Me.CustomerChkBx.Caption = "No"
clicked = False
Else
Me.CustomerChkBx.Caption = "Yes"
clicked = True
End If
End Sub
I thought it worked fine however, when I go to the next record the toggle
buton retains the label from the previous record. If I press the button in
the caption goes from "No" to "Yes" as it is supposed to and it will change
back and forth each time it's pressed. But, when I got to the next record the
button will read what ever the last state was. So if I press the button it
will read "Yes" and shows that it's pressed in then when I go to the next
record the caption will read "Yes" and the button will not be pressed in. If
I then press the button it will change the caption to "No" and show that it
is pressed. Isn't there a way I can reset it for the next form to "No" so my
form works.