Is there any way to make a custom toggle button in Access? I'm looking to create an on/off switch. The built in toggle button is fugly.
I have already created the on/off/hover images in photoshop. Is there a way to import them code them to work like the built in toggle button?
When you choose a toggle button that's bound to a Yes/No field, Microsoft Access displays the value in the underlying table according to the field's Format property (Yes/No, True/False, or On/Off). Toggle buttons are most useful when used in an option group with other buttons.
Right-click on the label and view its properties. Set the Back Color property of the label to the color that you want.
It should be easy enough to simply adjust the picture property, for example:
Private Sub Toggle0_Click()
If Me.Toggle0 Then
Me.Toggle0.Picture = "Z:\Docs\Picture1.bmp"
Else
Me.Toggle0.Picture = "Z:\Docs\Picture2.bmp"
End If
End Sub
Access 2010 has an AMAZING button editor, and the combinations and glow and shadow effects are amazing. In less time to type this sentence, I made these toggle buttons:
In above the button differences is when the button is depressed or not (so dark blue examples above are those that are depressed)
Here is a screen cap of the built in tools in Access used to create the above – I did not use any 3rd party tools to build the above. As pointed out by others here you can include an image with the button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With