A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"All" as a combo box option



 
 
Thread Tools Display Modes
  #1  
Old March 25th, 2008, 01:45 PM posted to microsoft.public.access.forms
Jon M.
external usenet poster
 
Posts: 51
Default "All" as a combo box option

I have a form with 3 combo boxes. One for Building, Dept., and Floor#. They
retreive employee records and display them on a subform. I would like to
have an "All" option in each of the combo boxes that will display all the
records for that field.
For example I could then choose Building A, Banking Dept, and "all" in the
last combo box and see all employees in Building A in the banking dept, on
every floor.

Or, "All", Banking, 3rd Floor and I would see every employee in the banking
dept on the 3rd floor in each of the buildings. Does that make sense?
As always any help is greatly appreciated!
--
Jon M.
  #2  
Old March 25th, 2008, 02:32 PM posted to microsoft.public.access.forms
Maurice
external usenet poster
 
Posts: 1,585
Default "All" as a combo box option

Take a look here maybe this will help you on your way...

http://www.mvps.org/access/forms/frm0043.htm

hth
--
Maurice Ausum


"Jon M." wrote:

I have a form with 3 combo boxes. One for Building, Dept., and Floor#. They
retreive employee records and display them on a subform. I would like to
have an "All" option in each of the combo boxes that will display all the
records for that field.
For example I could then choose Building A, Banking Dept, and "all" in the
last combo box and see all employees in Building A in the banking dept, on
every floor.

Or, "All", Banking, 3rd Floor and I would see every employee in the banking
dept on the 3rd floor in each of the buildings. Does that make sense?
As always any help is greatly appreciated!
--
Jon M.

  #3  
Old March 25th, 2008, 03:18 PM posted to microsoft.public.access.forms
Jon M.
external usenet poster
 
Posts: 51
Default "All" as a combo box option

this is definitely pointing me in the right direction, thanks!
--
Jon M.


"Maurice" wrote:

Take a look here maybe this will help you on your way...

http://www.mvps.org/access/forms/frm0043.htm

hth
--
Maurice Ausum


"Jon M." wrote:

I have a form with 3 combo boxes. One for Building, Dept., and Floor#. They
retreive employee records and display them on a subform. I would like to
have an "All" option in each of the combo boxes that will display all the
records for that field.
For example I could then choose Building A, Banking Dept, and "all" in the
last combo box and see all employees in Building A in the banking dept, on
every floor.

Or, "All", Banking, 3rd Floor and I would see every employee in the banking
dept on the 3rd floor in each of the buildings. Does that make sense?
As always any help is greatly appreciated!
--
Jon M.

  #4  
Old March 25th, 2008, 04:44 PM posted to microsoft.public.access.forms
Ron2006
external usenet poster
 
Posts: 936
Default "All" as a combo box option

What I have done in some situations when the data is relatively
limited, is the following

In the qurey that is actually retrieving the records, change the
criteria to be
like "*" & form![Formname]![comboxname] & "*"

instead of the normal form![Formname]![comboxname]

That way when there is NO value in the combobox it get all records.

Whereas using "ALL" requires logic to change the query when the ALL
condition occurs.

I don't believe that this would work if the bound informatioin is the
ID instead of the data in a combobox situation.

Where I use this mostly is when I have no positive control over the
data that is stored in the field that I am allowing the search on.

Ron

  #5  
Old March 25th, 2008, 04:51 PM posted to microsoft.public.access.forms
Jon M.
external usenet poster
 
Posts: 51
Default "All" as a combo box option

I tried to use this code but I am getting an error message when I open the
form. The message is Compile Error: Method or data member not found. My
code is correct I think it is:
Private Sub Form_Open(Cancel As Integer)
With Me.OfficeLoc
.RowSourceType = "Value List"
.RowSource = "(All);" & .RowSource
End With
End Sub

OfficeLoc is the name of my control box. Any suggestions what I'm doing
wrong?
--
Jon M.


"Maurice" wrote:

Take a look here maybe this will help you on your way...

http://www.mvps.org/access/forms/frm0043.htm

hth
--
Maurice Ausum


"Jon M." wrote:

I have a form with 3 combo boxes. One for Building, Dept., and Floor#. They
retreive employee records and display them on a subform. I would like to
have an "All" option in each of the combo boxes that will display all the
records for that field.
For example I could then choose Building A, Banking Dept, and "all" in the
last combo box and see all employees in Building A in the banking dept, on
every floor.

Or, "All", Banking, 3rd Floor and I would see every employee in the banking
dept on the 3rd floor in each of the buildings. Does that make sense?
As always any help is greatly appreciated!
--
Jon M.

  #6  
Old March 25th, 2008, 06:05 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default "All" as a combo box option

On which line is the error occuring?
--
Dave Hargis, Microsoft Access MVP


"Jon M." wrote:

I tried to use this code but I am getting an error message when I open the
form. The message is Compile Error: Method or data member not found. My
code is correct I think it is:
Private Sub Form_Open(Cancel As Integer)
With Me.OfficeLoc
.RowSourceType = "Value List"
.RowSource = "(All);" & .RowSource
End With
End Sub

OfficeLoc is the name of my control box. Any suggestions what I'm doing
wrong?
--
Jon M.


"Maurice" wrote:

Take a look here maybe this will help you on your way...

http://www.mvps.org/access/forms/frm0043.htm

hth
--
Maurice Ausum


"Jon M." wrote:

I have a form with 3 combo boxes. One for Building, Dept., and Floor#. They
retreive employee records and display them on a subform. I would like to
have an "All" option in each of the combo boxes that will display all the
records for that field.
For example I could then choose Building A, Banking Dept, and "all" in the
last combo box and see all employees in Building A in the banking dept, on
every floor.

Or, "All", Banking, 3rd Floor and I would see every employee in the banking
dept on the 3rd floor in each of the buildings. Does that make sense?
As always any help is greatly appreciated!
--
Jon M.

  #7  
Old March 25th, 2008, 06:30 PM posted to microsoft.public.access.forms
Ron2006
external usenet poster
 
Posts: 936
Default "All" as a combo box option

If the rowsource is a valuelist why are you not simply putting "(ALL)"
in there to start with?
  #8  
Old March 26th, 2008, 01:12 PM posted to microsoft.public.access.forms
Jon M.
external usenet poster
 
Posts: 51
Default "All" as a combo box option

I have "(All)" as a value in my field list but when I select it it doesn't
display any records at all. I know there is something I'm missing but I just
don't know what it is.
--
Jon M.


"Ron2006" wrote:

If the rowsource is a valuelist why are you not simply putting "(ALL)"
in there to start with?

  #9  
Old March 26th, 2008, 01:45 PM posted to microsoft.public.access.forms
Jon M.
external usenet poster
 
Posts: 51
Default "All" as a combo box option

I got the error to go away there was a labeling issue I had to address. Now
my code is exactly as it should be, so it seems. However when I select (All)
it still does not display all the records for that area, in fact it doesn't
show me any records. I know I'm missing something but I don't know what it
is. Any suggestions? Thanks in advance.
--
Jon M.


"Klatuu" wrote:

On which line is the error occuring?
--
Dave Hargis, Microsoft Access MVP


"Jon M." wrote:

I tried to use this code but I am getting an error message when I open the
form. The message is Compile Error: Method or data member not found. My
code is correct I think it is:
Private Sub Form_Open(Cancel As Integer)
With Me.OfficeLoc
.RowSourceType = "Value List"
.RowSource = "(All);" & .RowSource
End With
End Sub

OfficeLoc is the name of my control box. Any suggestions what I'm doing
wrong?
--
Jon M.


"Maurice" wrote:

Take a look here maybe this will help you on your way...

http://www.mvps.org/access/forms/frm0043.htm

hth
--
Maurice Ausum


"Jon M." wrote:

I have a form with 3 combo boxes. One for Building, Dept., and Floor#. They
retreive employee records and display them on a subform. I would like to
have an "All" option in each of the combo boxes that will display all the
records for that field.
For example I could then choose Building A, Banking Dept, and "all" in the
last combo box and see all employees in Building A in the banking dept, on
every floor.

Or, "All", Banking, 3rd Floor and I would see every employee in the banking
dept on the 3rd floor in each of the buildings. Does that make sense?
As always any help is greatly appreciated!
--
Jon M.

  #10  
Old March 26th, 2008, 02:15 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default "All" as a combo box option

Presumably your SQL currently has something like:

WHERE Field = Forms!FormName!NameOfCombobox

as a criteria. You need to change that to

WHERE (Field = Forms!FormName!NameOfCombobox OR
Forms!FormName!NameOfCombobox = "(All)")

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Jon M." wrote in message
...
I have "(All)" as a value in my field list but when I select it it doesn't
display any records at all. I know there is something I'm missing but I
just
don't know what it is.
--
Jon M.


"Ron2006" wrote:

If the rowsource is a valuelist why are you not simply putting "(ALL)"
in there to start with?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.