Toggle Button assistance (1 Viewer)

Knivag

New member
Local time
Today, 19:03
Joined
Nov 30, 2005
Messages
8
Hi, I would like to have a toggle button on my form that when clicked it changes the button colour and the button text. The toggle button doesnt have to be bound.

cheers
 

ssteinke

for what it's worth
Local time
Today, 05:03
Joined
Aug 2, 2003
Messages
195
try something like this to change the caption and forecolor:
Code:
If Me.ToggleName = True Then
    Me.ToggleName.Caption = "ON"
    Me.ToggleName.ForeColor = vbRed
Else
    Me.ToggleName.Caption = "OFF"
    Me.ToggleName.ForeColor = vbBlack
End If

I don't believe, however, you can change the background color.

~Scott
 

Knivag

New member
Local time
Today, 19:03
Joined
Nov 30, 2005
Messages
8
Thanks for the Help,

I will try it, I have seen it done before but I'm unable to contact the guy that did it as he has moved OS.

Another quick question, if I have the toggle on the form and other users also have the form open can I force an update on their forms to show the change?

Cheers
 

Knivag

New member
Local time
Today, 19:03
Joined
Nov 30, 2005
Messages
8
Still Trying to get this to work

Hi,

I'm still battling as my knowlwdge of Access code is very limited.

I have included a sample database showing what I am trying to do.

Someones help would be great...
 

Attachments

  • Toggle.zip
    14.6 KB · Views: 134

ssteinke

for what it's worth
Local time
Today, 05:03
Joined
Aug 2, 2003
Messages
195
To fix the problem with the toggle showing properly when the form is opened, place some code in the OnCurrent Event. See attached sample.

As for updates showing on another computer, that should be a simple as placing some requery code in your timer event, you can decide how long you want the form to requery by setting the Timer Interval.
 

Attachments

  • Toggle.zip
    15.9 KB · Views: 122

Users who are viewing this thread

Top Bottom