Toggle buttons

G

Guest

How do you create toggle buttons to show up on your form. An example is the
Northwind Database Form Customer Phone List. There are toggle buttons at the
bottom of the form that you can select to pull up customers whose name starts
with a certain letter.
 
G

George Nicholson

If you look carefully, those are toggle buttons in an Option Group (a very
big option group). There is a macro attached to the AfterUpdate event of
the option group that filters the data on the form based on the "option"
selected.

HTH,
 
G

Guest

George:

Can you go into a little more detail. I'm pretty good with Access, but have
never used toggle buttons before, nor did they talk about them in class.
Your help will be much appreciated.
 
G

George Nicholson

It's an option group (with 26+ options: A, B,...Z, All). Only one control
within an Option group can be selected at any given time, so any "toggling"
is done automatically when a different selection is made.

There are 3 choices for how controls appear within the group: "Radio
buttons", check boxes and toggle buttons. Radio buttons are probably more
commonly used for option groups and that may be throwing you off. Options
groups "usually" have a lot fewer options (3-5) as well.

Activate the toolbox wizard & try creating an option group and you'll see.
1st Step, "Label Names", 1 line for every letter of the alphabet plus "All",
etc. Selecting Toggle buttons as the Control type will be the 2nd to last
step of the wizard.

HTH,
 
R

Robin Chapple

I am also planning to use option buttons for the first time.

My wizard appears to be on strike. When I select the option button
from the tool box I just get one button with a label - no wizard.

I have changed the subject in order to keep it separate from the other
problem.

Robin Chapple
 
R

Rick Brandt

Robin said:
I am also planning to use option buttons for the first time.

My wizard appears to be on strike. When I select the option button
from the tool box I just get one button with a label - no wizard.

I have changed the subject in order to keep it separate from the other
problem.

Not all of the objects on the Toolbox have a wizard. What would you expect
the wizard for an OptionButton to do?
 
D

Dirk Goldgar

Robin Chapple said:
I am also planning to use option buttons for the first time.

My wizard appears to be on strike. When I select the option button
from the tool box I just get one button with a label - no wizard.

I have changed the subject in order to keep it separate from the other
problem.

If you just pick a toggle button from the toolbox, the wizard doesn't
get involved. But if you pick the option group tool, the Option Group
Wizard will start -- if you have the wizards turned on, that is -- and
guide you through the process of creating an option group. As part of
that process, you pick the type of option controls you want the option
group to contain, which may be toggle buttons.
 
G

Guest

Hi,
I like this northwind example but it only applies to the form that is
currently open, Customer Phone List. I need it to do the same thing with a
bunch of buttons that represent economic variables, and when you hit the
button, it queries a table and shows a datasheet with the specified records.
I tried using Apply Filter with no success. Do I need to use VBA code for
this action or is there something I'm missing? I don't want to use the Open
Query macro each time and create a separate query (there would be about 80 of
them).

thanks!
sophie
 
D

Dirk Goldgar

sparkery said:
Hi,
I like this northwind example but it only applies to the form that is
currently open, Customer Phone List. I need it to do the same thing
with a bunch of buttons that represent economic variables, and when
you hit the button, it queries a table and shows a datasheet with the
specified records. I tried using Apply Filter with no success. Do I
need to use VBA code for this action or is there something I'm
missing? I don't want to use the Open Query macro each time and
create a separate query (there would be about 80 of them).

I think we'd all need more information before we could answer your
question. Probably you can use a list box or subform, and use code in
the option group's AfterUpdate event to set the rowsource/recordsource
of the list box/subform to an SQL statement that you generate on the
fly, based on the value of the option group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top