Full Version: toggle button doesn't work
UtterAccess Forums > Microsoft® Access > Access Forms
weissbook
this happens to me occasionaly, and I just can't figure out why; Toggle button just doesn't work.
What's agrevating this time is that it worked fine before the weekend, and now when I got back after the weekend - it doesn't work anymore.
Otried some very simple code in the onClick code - like MsgBox "Hi" - doesn't budge.
TIA
ace
>I tried some very simple code in the onClick code - like MsgBox "Hi" - doesn't budge.
My doesn't budge do you mean it doesn't visibly toggle or that the code
doesn't run?

I had a case not long ago where the button would not visibly toggle.
[Access 2002 v.10.6501.6626 sp3]
I deleted it and added a new one.
weissbook
it visibly toggles, but the code doesn't run.
already tried adding a new toggle button - the new one doesn't work either.
ace
> it visibly toggles, but the code doesn't run.
You mean the event your code is in doesn't happen? How do you know that
for sure? Did you try a simple msgbox or debug print from the event?
Maybe it's your code that does nothing.
weissbook
yes, the code is:
msgbox "hi"
just doesn't happen
ansentry
Toggle button only react to True or False.

Put this code behing you toggle button's On Cliick Event:

Change the name of your Toggle Button to suit code:

CODE

If Me.Toggle0 = True Then
MsgBox "True - Down"
ElseIf Me.Toggle0 = False Then
MsgBox "False - UP"
End If



This is probably the correct way to code it:


CODE
If Me.Toggle0 = True Then
MsgBox "True - Down"
Else
MsgBox "False - UP"
End If
End Sub


Edited by: ansentry on Tue Jan 24 4:36:36 EST 2006.
Edited by: ansentry on Tue Jan 24 4:40:19 EST 2006.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.