Toggle On Off Button (1 Viewer)

isladogs

CID VIP
Local time
Today, 22:32
Joined
Jan 14, 2017
Messages
16,388
Hi all

Does anyone know of a form control which can act in a similar way to those below.



I looked through the Active X list but can't see anything obvious that's similar

Happy Xmas to everyone
 

Attachments

  • ToggleOnOff.PNG
    ToggleOnOff.PNG
    3.1 KB · Views: 256

jleach

Registered User.
Local time
Today, 17:32
Joined
Jan 4, 2012
Messages
308
Not aware of one offhand, but can you use two stacked images and set their Visible property accordingly?

Not sure of any way to handle nice transitions in Access though.

If you really wanted to could embed a web browser and use any one of hundreds of HTML/CSS ones, but that's a bit much.

Cheers
 

isladogs

CID VIP
Local time
Today, 22:32
Joined
Jan 14, 2017
Messages
16,388
I thought of 2 images but felt it would look clunky
Or a 2 value slider .. also clunky

I thought it would be a neater way of setting program settings than a Yes/No or On/Off combo
However, unless there's a ready made control, it isn't really worth the effort
 

jdraw

Super Moderator
Staff member
Local time
Today, 17:32
Joined
Jan 23, 2006
Messages
14,431
I was thinking of 2 images also. And thinking setting a default, then on click revert to other image, but it seems clunky (if doable, at best). Saw this from Gina, but no already built control.

Merry Christmas.
 

isladogs

CID VIP
Local time
Today, 22:32
Joined
Jan 14, 2017
Messages
16,388
Hi Jack

Thanks for the link to Gina's site - I've not looked at it for a long time.
Have a great Xmas
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:32
Joined
Feb 19, 2013
Messages
14,695
you can use a button - use format to select a quick style but you would need code to set border, back and fore colors - plus code to change the alignment. Use Windings font (lowercase L) or webdings (lowercase N)

the code would be something like

Function formatButton(isOn as Boolean, ctrl As Control)

If isOn Then
ctrl.BorderColor = vbBlue
ctrl.BackColor = vbBlue
ctrl.ForeColor = vbWhite
ctrl.Alignment = 3
Else
ctrl.BorderColor = vbBlack
ctrl.BackColor = vbWhite
ctrl.ForeColor = vbBlack
ctrl.Alignment = 0
End If

End Function
code needs a bit more for the hover

 

Attachments

  • Capture.JPG
    Capture.JPG
    1.8 KB · Views: 217
Last edited:

isladogs

CID VIP
Local time
Today, 22:32
Joined
Jan 14, 2017
Messages
16,388
Hi Chris
Many thanks for my Xmas present :)



It never occurred to me to use Quick Styles - in fact I tend to forget they exist!
2 minutes work & I have exactly what I wanted!
The hover colour bit was also easy

Definitely worth giving you more RPs but the forum rules won't let me do so again

So all I can do is to say a very merry Xmas to you as well Chris :D

EDIT: Now if you can also help me retrieve my own code from an accde file where I've deleted the original accdb, I'll know for sure Santa Claus exists ....
 

Attachments

  • ToggleButton.PNG
    ToggleButton.PNG
    4.2 KB · Views: 269
Last edited:

isladogs

CID VIP
Local time
Today, 22:32
Joined
Jan 14, 2017
Messages
16,388
Wayne Phillips can do that for you. I'm not sure he dresses up in a red suit though.

http://www.everythingaccess.com/mdeconversion.asp

Cheers

Thanks Jack.
That's good to have in reserve for future reference

However Santa really has arrived as I found the old accdb file
And much more importantly I've just become a proud grandparent in the last half hour. Baby boy born just after 1am on Xmas day

Signing off now.
Happy xmas
 

jdraw

Super Moderator
Staff member
Local time
Today, 17:32
Joined
Jan 23, 2006
Messages
14,431
Colin,

Glad you have it resolved. And congrats on the Christmas baby!!!
 

isladogs

CID VIP
Local time
Today, 22:32
Joined
Jan 14, 2017
Messages
16,388
Thanks. Best present ever. Mum and baby Charlie both doing well.
 

Users who are viewing this thread

Top Bottom