Search code examples
vbams-accessms-access-2016

I added toggle buttons on the access form like (YES or NO). How to save a value in the table, pressing on the respective buttons


I added toggle buttons on the MS ACCESS 2016 Form like (YES or NO). How to save a value in the table, pressing on the respective buttons and one more action is required, when I press the button change the colour (YES - "GREEN", NO - "RED"). Please help me with this.

enter image description here


Solution

  • Create an option group with toggle buttons, not separate buttons. You can bind the option group to the field in database, it will show selected and saved option.

    You can adjust pressed color for each of buttons separately, so select green color for background of Yes button and red for No

    If you need 3 state options (both not pressed, pressed Yes, pressed No), create option group with 3 buttons, default is neutral and make neutral button invisible