Report with a choice

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to create a parameter within a report that asks for specific info; however, I would like a drop down box (combo) just a list that they can click on and choose from, is this possible
 
Definitely!

Use a form to put your combo on; for the sake of this example I'll assume
the names Form1 and cbo1 respectively.
If your report's recordsource is a table, then make a query on that table,
select all the fields required for the report, and in the field on which you
wish to filter add the following criterion:
Forms!Form1!cbo1
(adjuct the names to the actual ones)
Now your query returns records fuiltered by your choice in the combo, as
long as the form is open. The only other thing remaining to do is change the
report's recordsource from the original table to the new query.
If your report's recordsource is already a query, then open it in design
view and add the criterion as above and you're done.
If you want you can add a command button on the form to open the report.

HTH,
Nikos

Charlie said:
I would like to create a parameter within a report that asks for specific
info; however, I would like a drop down box (combo) just a list that they
can click on and choose from, is this possible?
 
Nikos is correct. You can open the form in your "switchboard" instead of
opening the report or you can have the report open the form in the report's
Open event. If you do the latter, use the acDialog window mode argument in
the DoCmd.OpenForm call. This will pause the code in the report until you
close or hide the form. Have two buttons on the form (i.e. Continue and
Cancel). If you click Continue, set the visible property of the form to
false, this will let the report continue but the form will still be open for
the query to get the selection from it. If you click cancel, close the form.
In the next line of code in the report, check to see if the form is still
open. If it's not, then you know the user chose cancel and you can cancel
the opening of the report. If the form is still open, close it when you
close the report.

--
Wayne Morgan
Microsoft Access MVP


Charlie said:
I would like to create a parameter within a report that asks for specific
info; however, I would like a drop down box (combo) just a list that they
can click on and choose from, is this possible?
 
I am haviang the same problem. I am trying to create a
form with a combo box that displays a list of names for
the user to select which name to run the report on. I've
created my query based on two joined tables and set the
criteria for the query for which records I want. I
created my form with a combo box. I included the [forms]!
[form name]![field name] statment in the criteria for the
field I want to filter. However, when I run the query or
report, the dialog box that appears is a "normal" dialog
box with an empty text field to type the name, not my form
or fields just like you would receive with any parameter
you set within the query. When you add the combo box to
the form, do you leave the combo box unbound or do you set
it to a field within a table or query? When you are
creating the form, do you specify which table it is based
on?
 
Carla,

Unbound combo, no need for recordsource for the form (but no difference if
one exists). I suspect the reason you are still getting the inputbox is you
have a parameter reference in your query design,. Open the query in design
view, go to menu item Query > Parameters and remove the declaration that
matches the prompt you get in the inputbox. This should solve it.

HTH,
Nikos

Carla Rapps said:
I am haviang the same problem. I am trying to create a
form with a combo box that displays a list of names for
the user to select which name to run the report on. I've
created my query based on two joined tables and set the
criteria for the query for which records I want. I
created my form with a combo box. I included the [forms]!
[form name]![field name] statment in the criteria for the
field I want to filter. However, when I run the query or
report, the dialog box that appears is a "normal" dialog
box with an empty text field to type the name, not my form
or fields just like you would receive with any parameter
you set within the query. When you add the combo box to
the form, do you leave the combo box unbound or do you set
it to a field within a table or query? When you are
creating the form, do you specify which table it is based
on?
-----Original Message-----
Definitely!

Use a form to put your combo on; for the sake of this example I'll assume
the names Form1 and cbo1 respectively.
If your report's recordsource is a table, then make a query on that table,
select all the fields required for the report, and in the field on which you
wish to filter add the following criterion:
Forms!Form1!cbo1
(adjuct the names to the actual ones)
Now your query returns records fuiltered by your choice in the combo, as
long as the form is open. The only other thing remaining to do is change the
report's recordsource from the original table to the new query.
If your report's recordsource is already a query, then open it in design
view and add the criterion as above and you're done.
If you want you can add a command button on the form to open the report.

HTH,
Nikos

asks for specific
info; however, I would like a drop down box (combo) just a list that they
can click on and choose from, is this possible?


.
 
Still not working, so I created a new series of queries,
dialog form and report with very few fields. TestForm is
unbound and no recordsource. Has only a combo box
(Combo1) on it. TestQuery requests ID #, name and phone
number from the same table. In the criteria section for
the name field in the query design, I entered [Forms]!
[testform]![combo1]. Created my report against
TestQuery. When I run the report, a plain default
parameter box still displays for entry of the name. I
even tried creating a macro to run TestQuery on open for
the report and still the same. The parameter box has the
[forms]![Testform]![Combo1] reference above the text field
to enter the name. Is there soemthing I'm missing? Am I
supposed to run an event somewhere or another macro
somewhere to call this form to open? As far as I can
tell, I've followed your advice and instructions to the
letter. Thank you for your help.
-----Original Message-----
Carla,

Unbound combo, no need for recordsource for the form (but no difference if
one exists). I suspect the reason you are still getting the inputbox is you
have a parameter reference in your query design,. Open the query in design
view, go to menu item Query > Parameters and remove the declaration that
matches the prompt you get in the inputbox. This should solve it.

HTH,
Nikos

Carla Rapps said:
I am haviang the same problem. I am trying to create a
form with a combo box that displays a list of names for
the user to select which name to run the report on. I've
created my query based on two joined tables and set the
criteria for the query for which records I want. I
created my form with a combo box. I included the [forms]!
[form name]![field name] statment in the criteria for the
field I want to filter. However, when I run the query or
report, the dialog box that appears is a "normal" dialog
box with an empty text field to type the name, not my form
or fields just like you would receive with any parameter
you set within the query. When you add the combo box to
the form, do you leave the combo box unbound or do you set
it to a field within a table or query? When you are
creating the form, do you specify which table it is based
on?
-----Original Message-----
Definitely!

Use a form to put your combo on; for the sake of this example I'll assume
the names Form1 and cbo1 respectively.
If your report's recordsource is a table, then make a query on that table,
select all the fields required for the report, and in
the
field on which you
wish to filter add the following criterion:
Forms!Form1!cbo1
(adjuct the names to the actual ones)
Now your query returns records fuiltered by your choice in the combo, as
long as the form is open. The only other thing
remaining
to do is change the
report's recordsource from the original table to the
new
query.
If your report's recordsource is already a query, then open it in design
view and add the criterion as above and you're done.
If you want you can add a command button on the form to open the report.

HTH,
Nikos

"Charlie" <[email protected]> wrote
in
message
news:9A936025-D908-4A43-B076- (e-mail address removed)...
I would like to create a parameter within a report
that
asks for specific
info; however, I would like a drop down box (combo)
just
a list that they
can click on and choose from, is this possible?



.


.
 
Carla,

You got me there, not much more I can tell you. If you want, you're welcome
to zip your .mdb and mail it to nyannaco at in dot gr so I can have a look.

Nikos

Carla Rapps said:
Still not working, so I created a new series of queries,
dialog form and report with very few fields. TestForm is
unbound and no recordsource. Has only a combo box
(Combo1) on it. TestQuery requests ID #, name and phone
number from the same table. In the criteria section for
the name field in the query design, I entered [Forms]!
[testform]![combo1]. Created my report against
TestQuery. When I run the report, a plain default
parameter box still displays for entry of the name. I
even tried creating a macro to run TestQuery on open for
the report and still the same. The parameter box has the
[forms]![Testform]![Combo1] reference above the text field
to enter the name. Is there soemthing I'm missing? Am I
supposed to run an event somewhere or another macro
somewhere to call this form to open? As far as I can
tell, I've followed your advice and instructions to the
letter. Thank you for your help.
-----Original Message-----
Carla,

Unbound combo, no need for recordsource for the form (but no difference if
one exists). I suspect the reason you are still getting the inputbox is you
have a parameter reference in your query design,. Open the query in design
view, go to menu item Query > Parameters and remove the declaration that
matches the prompt you get in the inputbox. This should solve it.

HTH,
Nikos

Carla Rapps said:
I am haviang the same problem. I am trying to create a
form with a combo box that displays a list of names for
the user to select which name to run the report on. I've
created my query based on two joined tables and set the
criteria for the query for which records I want. I
created my form with a combo box. I included the [forms]!
[form name]![field name] statment in the criteria for the
field I want to filter. However, when I run the query or
report, the dialog box that appears is a "normal" dialog
box with an empty text field to type the name, not my form
or fields just like you would receive with any parameter
you set within the query. When you add the combo box to
the form, do you leave the combo box unbound or do you set
it to a field within a table or query? When you are
creating the form, do you specify which table it is based
on?
-----Original Message-----
Definitely!

Use a form to put your combo on; for the sake of this
example I'll assume
the names Form1 and cbo1 respectively.
If your report's recordsource is a table, then make a
query on that table,
select all the fields required for the report, and in the
field on which you
wish to filter add the following criterion:
Forms!Form1!cbo1
(adjuct the names to the actual ones)
Now your query returns records fuiltered by your choice
in the combo, as
long as the form is open. The only other thing remaining
to do is change the
report's recordsource from the original table to the new
query.
If your report's recordsource is already a query, then
open it in design
view and add the criterion as above and you're done.
If you want you can add a command button on the form to
open the report.

HTH,
Nikos

message
news:9A936025-D908-4A43-B076- (e-mail address removed)...
I would like to create a parameter within a report that
asks for specific
info; however, I would like a drop down box (combo) just
a list that they
can click on and choose from, is this possible?



.


.
 
Back
Top