Option Group SOS

J

Julius

I really trully trully need help on this in a fast way. I created an option
group with 12 radio buttons if you will. These buttons are based on 12
fields in my New monitor Table, these fields represent the 12 Call Center.
So If I select Option 1 it should attach the record to say Dental Call
Center, however nothing happens, I change each Value to its appropriate
number from 1 to twelve. My Question is How do I get whatever option or
radio button I select to show it as being selected in my table. Sorry but I
need this in a major way. Please HELP.
 
J

Julius

Not using code, yes the form is bound to a query, and the 12 option groups
are suppose to be bound to 12 fields in the query. Have not selected an
event, I am clealy not use to doing this.
 
J

Julius

Thank you so much for your prompt responses. I have 12 fields in my Query,
they are as follows: CallCenter1, CallCenter2, CallCenter3, CallCenter4, etc
up to twelve. I created an option box on the form with 12 buttons to
reference each. I take it that is wrong Huh? I need to be able to use my
form and select the appropriate option for where that Audit goes, then I need
to build a form that allows me to run a report and select any or all of those
options.
 
K

Klatuu

The main problem is you are commiting spreadsheet.
You should not nave twelve fields, one for each call enter.
You should have one field that identifies the call center and you should
have a small table with 12 rows with two fields, an autonumber primary key
and a text field with a description of the call center.

The field in the main table should carry the value of the primary key field
in the call center table.

Then instead of an option group, it should be a combo box. Now your query
can filter on the value of the combo box.
 
J

Julius

Funny, I have it setup like that. I did the the other way as an experiement,
however the original database is setup as you describe, Question How do I
create a form that will allow me to select a call center to run a report off
of based on say combo boxes or radio buttons.
 
J

John W. Vinson

Funny, I have it setup like that. I did the the other way as an experiement,
however the original database is setup as you describe, Question How do I
create a form that will allow me to select a call center to run a report off
of based on say combo boxes or radio buttons.

If you have a numeric CallCenterID in your table, create an Option Group
(optCallCenter say) with its Control Source being the CallcenterID. Note:
that's the control source *of the option group control*, not the control
source of any of the buttons within that control!

Add twelve buttons to the option group (the wizard will help), assigning them
numeric values corresponding to the different call centers; put the name of
the call center in the label of each button.
 
J

Julius

Thank you all very much for your help. I created exactly what you stated
below. How do I connect the dots. I created the option box and pointed the
Control source to my Call Center Table attaching to the Category ID. I am
assuming on my Query I should have the Category ID I put that on my query but
it doesn't want to show any of my data now. I think I am missing one small
step, how do I get the option buttons to work on the form and how do I
connect the Category code Table to the main query where the Category ID works.
 
J

Julius

Can someone help me to finish fixing this, I haven't heard any responses in a
while.
 
T

Tieske

Hi Julius,

I think your approach is wrong here. A group of options, only allows one to
be selected, hence there is only one value that is returned, not 12. To
resolve this, create 1 option group, add 12 option buttons to that group
(the group returns the value, not the options) and bind the option group to
a single field called "CallCenter" or whatever.

But... seems to me you might want to resolve this in another manner.
1) Create a second table "tblCallCenters", with 2 fields, 1st an
autonumber-type called CallCenterID, 2nd a text-type called
"CallCenterName". Add the names of the 12 callcenters to this table as
individual records.
2) In your "New monitor table" remove the 12 fields, and add one new field,
number type, (long integer), called "CallCenterID". On the tab "Lookup"
define the lookup parameters. Use a combobox, to look up the value for
"CallCenterID" in table "tblCallCenters", select both columns, bind to
column 1 (you might want to set column size of column 1 to 0 to hide the ID
number from the user, as it has no value to him/her).
3) Now open your form, remove the option buttons, and from the field list
drag the field "CallCenterID" (from table "New monitor table") on to your
form. Access will now automatically create a combo box that looks up the
value and stores it correctly.

hope this helps to solve your problem.

regards,
Tieske

PS. It might be a good idea to take some extra time when dropping a question
here, basically you typed the whole thing on a single line. This is hard to
read and to understand, hence many will easily skip such questions and move
on to the next....
 
J

Julius

Thank you very much for you asistance this was actually a life saver. still
one question remains, how do I put this on a form and select either one or
more of the call centers to run a report.
 
T

Tieske

Hi Julius,

I think your approach is wrong here. A group of options, only allows one to
be selected, hence there is only one value that is returned, not 12. To
resolve this, create 1 option group, add 12 option buttons to that group
(the group returns the value, not the options) and bind the option group to
a single field called "CallCenter" or whatever.

But... seems to me you might want to resolve this in another manner.
1) Create a second table "tblCallCenters", with 2 fields, 1st an
autonumber-type called CallCenterID, 2nd a text-type called
"CallCenterName". Add the names of the 12 callcenters to this table as
individual records.
2) In your "New monitor table" remove the 12 fields, and add one new field,
number type, (long integer), called "CallCenterID". On the tab "Lookup"
define the lookup parameters. Use a combobox, to look up the value for
"CallCenterID" in table "tblCallCenters", select both columns, bind to
column 1 (you might want to set column size of column 1 to 0 to hide the ID
number from the user, as it has no value to him/her).
3) Now open your form, remove the option buttons, and from the field list
drag the field "CallCenterID" (from table "New monitor table") on to your
form. Access will now automatically create a combo box that looks up the
value and stores it correctly.

hope this helps to solve your problem.

regards,
Tieske

PS. It might be a good idea to take some extra time when dropping a question
here, basically you typed the whole thing on a single line. This is hard to
read and to understand, hence many will easily skip such questions and move
on to the next....
 
J

Julius

Hi Tieske, your advice worked fine. What I want to do is open a short form
with a date range fields and either checkboxes or an option group that would
allow me to select the data I want to report on. So imagine a form with
begin and end date range field, then either 13 checkboxes or an option group
with 13 option radio buttons, I need to be able to select 1 or all of the
checkboxes or radio buttons when running a report based on the date range I
entered, is this feasible.
 
T

Tieske

Hi Julius,

good to know it worked.
About your new question; I wouldn't go with a series op checkboxes or an
option group in this case. I think a listbox is better suited. But it
depends on what solution you took from my earlier answer. Did you just
create an optiongroup, or did you create the extra table?

Steps:
1) Create a form with; startdate, enddate, and a listbox. If you created the
extra table, select this table to be displayed in the listbox and set the
"multiselect" option in the listbox (this allows you to select more than 1
item in a listbox). If you didn't create the extra table, then manually
provide the input and also set the multiselect option.
2) Create a query for your report and in the query make a selection, whilst
referring to the datefields on your form (you can only do this for the date
fields, because you don't know upfront how many callcenters will be selected
by the user)
3) create the report you want based upon the query from step 2.
4) on the form created in step 1, add a commandbutton and use the wizard to
have it open the report created in step 3 (don't add any additional
selection criteria, you already made those selections in the query).

By now you'll have a fully functional form, showing the required report,
except that is doesn't make the selection on the CallCenters selected in the
listbox.

5) Now open the VBA code related to the OnClick event of the commandbutton
created in step 4. Here you'll probably see a "DoCMD.OpenReport" command or
something similar that is being used to open the report.
Add code to loop through all items selected in the listbox, and create a
string that contains a filter. Add this filter to the OpenReport command in
the VBA code.

Step 5 added the selection on the CallCenters and should now provide you
with the required report. If you don't know how to handle step 5, then drop
me the code the wizard generated for the commandbutton in step 4.

regards,
Tieske
 
J

Julius

Tieske, thank you so much for your assistance in this. The list box works
perfectly. I did exactly the way you suggested. I do have one question
though, I have several macros that are used to run reports. example I have a
macro called Call Center Averages. This is where the macro will run a query
first that is called Call Center Averages, which calculates the numbers on
the report. Then the next action on the3 macro is open report, which opens a
report that was created using a make table. When I built a list box on one
of these and ran it, nothing happens. Can a list box be built on something
like this.
 
T

Tieske

Julius,

I'm not sure what your question is here...

from what I understand; you run multiple queries (MAKE) that generate some
table (presumably all with the same structure) and you run a report on that
table.
When does the listbox show? you show a form from where the final report is
being generated I presume, so when you click a button on that form the
report shows and you want the report to only show the items selected in your
listbox. Right?

Can you post the code created with step 5 below? That code should create the
filter to apply based upon the selection in the listbox.

regards,
Tieske
 

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

Top