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  

Adding all to combo



 
 
Thread Tools Display Modes
  #1  
Old March 20th, 2007, 01:40 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 34
Default Adding all to combo

Hi everyone,
How does one add "ALL" to a bound cbo box?

Cbo has two columns, bound to 1
RegionID
RegionName

Any Suggestions?
Thanks
Dave

  #2  
Old March 20th, 2007, 06:19 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Adding all to combo

It's easy enough to add All to the list:
http://www.mvps.org/access/forms/frm0043.htm

What's more difficult is making sense of interpreting it once you get it in
there.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message
oups.com...
Hi everyone,
How does one add "ALL" to a bound cbo box?

Cbo has two columns, bound to 1
RegionID
RegionName

Any Suggestions?
Thanks
Dave


  #3  
Old March 20th, 2007, 11:35 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 34
Default Adding all to combo

On Mar 19, 11:19 pm, "Allen Browne"
wrote:
It's easy enough to add All to the list:
http://www.mvps.org/access/forms/frm0043.htm

What's more difficult is making sense of interpreting it once you get it in
there.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message

oups.com...



Hi everyone,
How does one add "ALL" to a bound cbo box?


Cbo has two columns, bound to 1
RegionID
RegionName


Any Suggestions?
Thanks
Dave- Hide quoted text -


- Show quoted text -


Hi and thanks,
You are right on comment but got it!
Thanks again,
Dave

  #4  
Old March 20th, 2007, 12:04 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 34
Default Adding all to combo

On Mar 19, 11:19 pm, "Allen Browne"
wrote:
It's easy enough to add All to the list:
http://www.mvps.org/access/forms/frm0043.htm

What's more difficult is making sense of interpreting it once you get it in
there.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message

oups.com...



Hi everyone,
How does one add "ALL" to a bound cbo box?


Cbo has two columns, bound to 1
RegionID
RegionName


Any Suggestions?
Thanks
Dave- Hide quoted text -


- Show quoted text -


Hi again,
After following the link and reading it over good, I guess your answer
is you cannot do this unless I assign some sort of UID or a choose a
different primary Key for this table?

For example, if your combo's RowSource is this SQL statement
"(AND IT IS)"

SELECT CustomerID, CompanyName FROM Customers ORDER BY CustomerID;

you can then easily add "(All)" as the first choice. Also, if
CustomerID is the bound field but it's width is set to zero (so that
the user only sees CompanyName), you can store a NULL (if the bound
field is not the primary key of the table), or someother value in the
bound field.

SELECT CustomerID, CompanyName FROM Customers UNION Select Null as
AllChoice , "(All)" as Bogus From Customers ORDER BY CustomerID;

tHIS WOULD WORK FINE IN THE EVENT ONE DIDNT HAVE THE PRIMARY KEY
ASSIGNED TO THE BOUND COLUMN. WHAT THIS DOESNT SHOW IS WHAT IF THE
BOUND COLUMN IS THE PRIMARY KEY WHICH IN THIS ISNSTANCE IS MOST LIKELY
TRUE MOST OF THE TIME. IS THERE ANY DOCUMENTATION ANYWHERE THAT WOULD
EXPLAIN THE WHAT IF?
THANKS,
DAVE

  #5  
Old March 20th, 2007, 12:51 PM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Adding all to combo

If the combo is bound to a primary key (or any required field), then the
attempt to store the Null there is doomed to fail.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message
ups.com...
On Mar 19, 11:19 pm, "Allen Browne"
wrote:
It's easy enough to add All to the list:
http://www.mvps.org/access/forms/frm0043.htm

What's more difficult is making sense of interpreting it once you get it
in
there.

wrote in message

oups.com...



Hi everyone,
How does one add "ALL" to a bound cbo box?


Cbo has two columns, bound to 1
RegionID
RegionName


Any Suggestions?
Thanks
Dave- Hide quoted text -


- Show quoted text -


Hi again,
After following the link and reading it over good, I guess your answer
is you cannot do this unless I assign some sort of UID or a choose a
different primary Key for this table?

For example, if your combo's RowSource is this SQL statement
"(AND IT IS)"

SELECT CustomerID, CompanyName FROM Customers ORDER BY CustomerID;

you can then easily add "(All)" as the first choice. Also, if
CustomerID is the bound field but it's width is set to zero (so that
the user only sees CompanyName), you can store a NULL (if the bound
field is not the primary key of the table), or someother value in the
bound field.

SELECT CustomerID, CompanyName FROM Customers UNION Select Null as
AllChoice , "(All)" as Bogus From Customers ORDER BY CustomerID;

tHIS WOULD WORK FINE IN THE EVENT ONE DIDNT HAVE THE PRIMARY KEY
ASSIGNED TO THE BOUND COLUMN. WHAT THIS DOESNT SHOW IS WHAT IF THE
BOUND COLUMN IS THE PRIMARY KEY WHICH IN THIS ISNSTANCE IS MOST LIKELY
TRUE MOST OF THE TIME. IS THERE ANY DOCUMENTATION ANYWHERE THAT WOULD
EXPLAIN THE WHAT IF?
THANKS,
DAVE


  #6  
Old March 20th, 2007, 12:54 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Adding all to combo

How are you using the combo box?

If, for example, you're using it as a parameter in a query, you'd change the
WHERE clause from

WHERE FIeld1 = Forms!MyForm!MyComboBox

to

WHERE (FIeld1 = Forms!MyForm!MyComboBox OR Forms!MyForm!MyComboBox IS NULL)

If you're referring to the combo box in VBA, you use the IsNull function.

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


wrote in message
ups.com...

Hi again,
After following the link and reading it over good, I guess your answer
is you cannot do this unless I assign some sort of UID or a choose a
different primary Key for this table?

For example, if your combo's RowSource is this SQL statement
"(AND IT IS)"

SELECT CustomerID, CompanyName FROM Customers ORDER BY CustomerID;

you can then easily add "(All)" as the first choice. Also, if
CustomerID is the bound field but it's width is set to zero (so that
the user only sees CompanyName), you can store a NULL (if the bound
field is not the primary key of the table), or someother value in the
bound field.

SELECT CustomerID, CompanyName FROM Customers UNION Select Null as
AllChoice , "(All)" as Bogus From Customers ORDER BY CustomerID;

tHIS WOULD WORK FINE IN THE EVENT ONE DIDNT HAVE THE PRIMARY KEY
ASSIGNED TO THE BOUND COLUMN. WHAT THIS DOESNT SHOW IS WHAT IF THE
BOUND COLUMN IS THE PRIMARY KEY WHICH IN THIS ISNSTANCE IS MOST LIKELY
TRUE MOST OF THE TIME. IS THERE ANY DOCUMENTATION ANYWHERE THAT WOULD
EXPLAIN THE WHAT IF?
THANKS,
DAVE



  #7  
Old March 21st, 2007, 03:15 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 34
Default Adding all to combo

On Mar 20, 5:54 am, "Douglas J. Steele"
wrote:
How are you using the combo box?

If, for example, you're using it as a parameter in a query, you'd change the
WHERE clause from

WHERE FIeld1 = Forms!MyForm!MyComboBox

to

WHERE (FIeld1 = Forms!MyForm!MyComboBox OR Forms!MyForm!MyComboBox IS NULL)

If you're referring to the combo box in VBA, you use the IsNull function.

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

wrote in message

ups.com...





Hi again,
After following the link and reading it over good, I guess your answer
is you cannot do this unless I assign some sort of UID or a choose a
different primary Key for this table?


For example, if your combo's RowSource is this SQL statement
"(AND IT IS)"


SELECT CustomerID, CompanyName FROM Customers ORDER BY CustomerID;


you can then easily add "(All)" as the first choice. Also, if
CustomerID is the bound field but it's width is set to zero (so that
the user only sees CompanyName), you can store a NULL (if the bound
field is not the primary key of the table), or someother value in the
bound field.


SELECT CustomerID, CompanyName FROM Customers UNION Select Null as
AllChoice , "(All)" as Bogus From Customers ORDER BY CustomerID;


tHIS WOULD WORK FINE IN THE EVENT ONE DIDNT HAVE THE PRIMARY KEY
ASSIGNED TO THE BOUND COLUMN. WHAT THIS DOESNT SHOW IS WHAT IF THE
BOUND COLUMN IS THE PRIMARY KEY WHICH IN THIS ISNSTANCE IS MOST LIKELY
TRUE MOST OF THE TIME. IS THERE ANY DOCUMENTATION ANYWHERE THAT WOULD
EXPLAIN THE WHAT IF?
THANKS,
DAVE- Hide quoted text -


- Show quoted text -


The control or cbo is table/Query with record source set to Region.
The form is based on a query!

  #8  
Old March 21st, 2007, 11:56 AM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Adding all to combo

Sorry, you haven't answered the question. How are you using the combo box?
Are you trying to use it for Search purposes, or are you trying to use it to
add records to a table using the combo box as input? If you're trying to use
it for input, giving a choice of All really makes no sense.

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


wrote in message
oups.com...

The control or cbo is table/Query with record source set to Region.
The form is based on a query!

On Mar 20, 5:54 am, "Douglas J. Steele"

wrote:
How are you using the combo box?

If, for example, you're using it as a parameter in a query, you'd change
the
WHERE clause from

WHERE FIeld1 = Forms!MyForm!MyComboBox

to

WHERE (FIeld1 = Forms!MyForm!MyComboBox OR Forms!MyForm!MyComboBox IS
NULL)

If you're referring to the combo box in VBA, you use the IsNull function.

wrote in message

ups.com...
Hi again,
After following the link and reading it over good, I guess your answer
is you cannot do this unless I assign some sort of UID or a choose a
different primary Key for this table?


For example, if your combo's RowSource is this SQL statement
"(AND IT IS)"


SELECT CustomerID, CompanyName FROM Customers ORDER BY CustomerID;


you can then easily add "(All)" as the first choice. Also, if
CustomerID is the bound field but it's width is set to zero (so that
the user only sees CompanyName), you can store a NULL (if the bound
field is not the primary key of the table), or someother value in the
bound field.


SELECT CustomerID, CompanyName FROM Customers UNION Select Null as
AllChoice , "(All)" as Bogus From Customers ORDER BY CustomerID;


tHIS WOULD WORK FINE IN THE EVENT ONE DIDNT HAVE THE PRIMARY KEY
ASSIGNED TO THE BOUND COLUMN. WHAT THIS DOESNT SHOW IS WHAT IF THE
BOUND COLUMN IS THE PRIMARY KEY WHICH IN THIS ISNSTANCE IS MOST LIKELY
TRUE MOST OF THE TIME. IS THERE ANY DOCUMENTATION ANYWHERE THAT WOULD
EXPLAIN THE WHAT IF?
THANKS,




 




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 07:15 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.