Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making custom toggle buttons in Access

Tags:

vba

ms-access

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?

like image 710
Alex Avatar asked Nov 07 '14 15:11

Alex


People also ask

How do I create a toggle button in access?

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.

How do I change the color of a button in access?

Right-click on the label and view its properties. Set the Back Color property of the label to the color that you want.


Video Answer


2 Answers

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
like image 129
Fionnuala Avatar answered Sep 26 '22 20:09

Fionnuala


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:

enter image description here

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.

enter image description here

like image 37
Albert D. Kallal Avatar answered Sep 25 '22 20:09

Albert D. Kallal