Add a All Option in Combo for Report

  • Thread starter chopper7898 via AccessMonster.com
  • Start date
C

chopper7898 via AccessMonster.com

I have a popup form when I select a report command button, the form has one
combo for names from a qurey where I can slect individual reports, I would
like to have an "All" in the combo drop down list.

My query's criteria is: [Forms]![frm_ReportSelector]![cboSelectInspector]

I seen something where I can add it to the criteria but can't find it.
Also a lot of post take me to a site that describes a short code about Row
Source Type being a "Value List"

My Row Source Type is "Table/Query"
and Row Source is: SELECT qry_NamesPersons.Name, qry_NamesPersons.Position
FROM qry_NamesPersons ORDER BY [Name];

Also keep getting "Enter Parameter Value" when I don't make a selection from
the combo and close the form.

Will keep looking and trying code.
Thanks.
 
D

Douglas J. Steele

There's no way to get around the prompt if you've closed the form.

To get All in the combo, change the RowSource to

SELECT qry_NamesPersons.Name, qry_NamesPersons.Position FROM
qry_NamesPersons UNION SELECT " All", " All" FROM qry_NamesPersons ORDER BY
[Name]

The space between the double quote and All is so that it'll sort to the top
of the list.

You'll also have to change your query's criteria to

[Forms]![frm_ReportSelector]![cboSelectInspector] OR
([Forms]![frm_ReportSelector]![cboSelectInspector] = " All")
 
K

Ken Sheridan

The leading spaces can be avoided by introducing an additional column:

SELECT [Name], Position, 1 AS SortColumn
FROM qry_NamesPersons
UNION
SELECT "All", "All", 0
FROM qry_NamesPersons
ORDER BY SortColumn, [Name];

Ken Sheridan
Stafford, England

Douglas J. Steele said:
There's no way to get around the prompt if you've closed the form.

To get All in the combo, change the RowSource to

SELECT qry_NamesPersons.Name, qry_NamesPersons.Position FROM
qry_NamesPersons UNION SELECT " All", " All" FROM qry_NamesPersons ORDER BY
[Name]

The space between the double quote and All is so that it'll sort to the top
of the list.

You'll also have to change your query's criteria to

[Forms]![frm_ReportSelector]![cboSelectInspector] OR
([Forms]![frm_ReportSelector]![cboSelectInspector] = " All")



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


chopper7898 via AccessMonster.com said:
I have a popup form when I select a report command button, the form has one
combo for names from a qurey where I can slect individual reports, I would
like to have an "All" in the combo drop down list.

My query's criteria is: [Forms]![frm_ReportSelector]![cboSelectInspector]

I seen something where I can add it to the criteria but can't find it.
Also a lot of post take me to a site that describes a short code about Row
Source Type being a "Value List"

My Row Source Type is "Table/Query"
and Row Source is: SELECT qry_NamesPersons.Name, qry_NamesPersons.Position
FROM qry_NamesPersons ORDER BY [Name];

Also keep getting "Enter Parameter Value" when I don't make a selection
from
the combo and close the form.

Will keep looking and trying code.
Thanks.
 
D

Douglas J. Steele

Good point, Ken. Guess I was just lazy.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ken Sheridan said:
The leading spaces can be avoided by introducing an additional column:

SELECT [Name], Position, 1 AS SortColumn
FROM qry_NamesPersons
UNION
SELECT "All", "All", 0
FROM qry_NamesPersons
ORDER BY SortColumn, [Name];

Ken Sheridan
Stafford, England

Douglas J. Steele said:
There's no way to get around the prompt if you've closed the form.

To get All in the combo, change the RowSource to

SELECT qry_NamesPersons.Name, qry_NamesPersons.Position FROM
qry_NamesPersons UNION SELECT " All", " All" FROM qry_NamesPersons ORDER
BY
[Name]

The space between the double quote and All is so that it'll sort to the
top
of the list.

You'll also have to change your query's criteria to

[Forms]![frm_ReportSelector]![cboSelectInspector] OR
([Forms]![frm_ReportSelector]![cboSelectInspector] = " All")



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


chopper7898 via AccessMonster.com said:
I have a popup form when I select a report command button, the form has
one
combo for names from a qurey where I can slect individual reports, I
would
like to have an "All" in the combo drop down list.

My query's criteria is:
[Forms]![frm_ReportSelector]![cboSelectInspector]

I seen something where I can add it to the criteria but can't find it.
Also a lot of post take me to a site that describes a short code about
Row
Source Type being a "Value List"

My Row Source Type is "Table/Query"
and Row Source is: SELECT qry_NamesPersons.Name,
qry_NamesPersons.Position
FROM qry_NamesPersons ORDER BY [Name];

Also keep getting "Enter Parameter Value" when I don't make a selection
from
the combo and close the form.

Will keep looking and trying code.
Thanks.
 
C

chopper7898 via AccessMonster.com

Thank you! it works great.
There's no way to get around the prompt if you've closed the form.

To get All in the combo, change the RowSource to

SELECT qry_NamesPersons.Name, qry_NamesPersons.Position FROM
qry_NamesPersons UNION SELECT " All", " All" FROM qry_NamesPersons ORDER BY
[Name]

The space between the double quote and All is so that it'll sort to the top
of the list.

You'll also have to change your query's criteria to

[Forms]![frm_ReportSelector]![cboSelectInspector] OR
([Forms]![frm_ReportSelector]![cboSelectInspector] = " All")
I have a popup form when I select a report command button, the form has one
combo for names from a qurey where I can slect individual reports, I would
[quoted text clipped - 16 lines]
Will keep looking and trying code.
Thanks.
 

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