Link to home
Start Free TrialLog in
Avatar of PeterFrb
PeterFrbFlag for United States of America

asked on

Toggle Buttons to filter in Access

My question has to do with deconstructing an existing Access 2007 form that works quite well. I believe the form at which I'm looking was created using an automated Wizard, but I can't find any Wizard behind the Curtain pulling any strings.  The form has a series of toggle buttons at the bottom of the form, labeled "A" through "Z", and each time I press on one of the buttons, the main dropdown menu is reset to the first item that begins with the selected letter.  

My question is "How?"  When I look at the form in design mode, I see that none of the toggle buttons have any event associated with them.  They are seemingly disassociated with the dropdown, although I am sarcastic when I say "seemingly" because they obviously do exert influence.  Each Toggle Button has a name "Filter E", "Filter T", etc., and each has an Option Value connected to the placement of that letter in the alphabet ("Filter E" = 5; "Fiter T" = 20; etc.).  Beyond this, I see nothing inherent in the form that does its work, although it clearly is.

For greater clarity, I'm including an image of one of the Toggle buttons and its properties.
Many thanks, ~Peter Ferber


ToggleButton-Properties.bmp
Avatar of Hamed Nasr
Hamed Nasr
Flag of Oman image

Check the AfterUpdate event of the optionFrame that contains all the toggle buttons.  The frame value = 1, 2, 3, ... for individual toggle buttons.

Code checks the number associated with each toggle button and filters accordingly.

Check the code behind the frame control.
See the option value 10 assigned to J, 10th toggle button in the option frame, in the image above.
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PeterFrb

ASKER

Thank you for the excellent concrete example of what was happening.  I understand now how toggle buttons are the equivalent of radio buttons, and the frame inherits the value of the toggle button, just as it would a radio button.