Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 29th, 2009, 08:38 PM
aznmaster aznmaster is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 34 aznmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 44 m 50 sec
Reputation Power: 1
Forms - Selective Display of a List of items into A Combo Box

I have a table with multiple columns. Columns 1,3,5, etc are lists of names that I want to be used to display in combo boxes. The rest of the columns are corresponding columns to 1,3,5 which are of type Yes/No selection to determine if I want the name hidden or not.

Is there a way that I can get names from this list to display in a combo box, but make sure the ones that have the Yes/No box checked to be hidden?

So far I've been able to list the names in a combo box from a single column,
list the names in a combo box from multiple columns,
list the names in a combo box from a single column and hiding some of the options by using a query,
But when I try to list the names from all columns, it doesn't do what I want.

What should I do? I'm kinda new to Access.
Thanks.

Reply With Quote
  #2  
Old June 29th, 2009, 09:04 PM
don94403's Avatar
don94403 don94403 is offline
Contributing User
Click here for more information.
 
Join Date: Jan 2007
Location: Northern California
Posts: 2,848 don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 18 h 41 m 42 sec
Reputation Power: 562
I can't figure out what you are doing. Instead of describing it in words, please show us exactly what your fields are in the table, like this:
Code:
[tableName]:
   id          Autonumber
   field1      Text
   field2      Text
... etc.
__________________
Experience is the thing you have left when everything else is gone.

Reply With Quote
  #3  
Old June 29th, 2009, 11:13 PM
aznmaster aznmaster is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 34 aznmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 44 m 50 sec
Reputation Power: 1
Okay, so my table design looks like this
Code:
[table1]:
   name1           Text
   name1_hide    Yes/No
[table2]:
   name2           Text
   name2_hide    Yes/No


And my table in datasheet view looks something like this

Code:
name1             name1_hide
Red                                                  
Blue                                     
Green             x                   
Yellow             

                      
name2             name2_hide
House                  
Apartment              
Condo             
name2-4               x


Bascially I want to have a combo box that lists: Red,Blue,Yellow, House, Apartment, Condo. (but not Green, and name2-4, because they're selected as hidden)

Reply With Quote
  #4  
Old June 30th, 2009, 07:30 PM
aznmaster aznmaster is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 34 aznmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 44 m 50 sec
Reputation Power: 1
Is there an easier way to do this than to create separate queries for each name column(e.g. name1, name2, name3, etc) and then combine them into one query to display in the combo box?

Reply With Quote
  #5  
Old June 30th, 2009, 09:46 PM
don94403's Avatar
don94403 don94403 is offline
Contributing User
Click here for more information.
 
Join Date: Jan 2007
Location: Northern California
Posts: 2,848 don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 18 h 41 m 42 sec
Reputation Power: 562
It's not at all clear to me what your table represents. It certainly looks like it is not a valid data structure for a relational database. In relational database design, a table represents an entity, which means a collection of a definable class of people, objects, documents, events, etc. So a table might be described as "students who attend this school" or "invoices for our sales" or "meetings between our clients and our staff"--those kinds of straightforward definitions.

Twenty years of database development has taught me that if I can't specify cleanly exactly WHAT a table represents, I can't use it in a relational database. The occurrence of "repeating groups" like your structure seems to have, is strictly prohibited by the rules of data normalization. If you want to try to explain what you are trying to accomplish in this database, perhaps I can offer some suggestions, but I wouldn't even try to use the structure you showed.

Last edited by don94403 : June 30th, 2009 at 09:48 PM.

Reply With Quote
  #6  
Old June 30th, 2009, 11:51 PM
aznmaster aznmaster is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 34 aznmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 44 m 50 sec
Reputation Power: 1
Thanks for trying to understand the problem I was having. I figured out the real problem is that indeed, like you said, the table makes no sense at all.
I have since changed it so that each set of related columns are now in their own table.
Table1 contains name1 and name1_hide
Table2 contains name2 and name2_hide

Though I've kind of worked around it, I was wondering if it was possible to use all the name1 and name2 values from the fields of both tables(making sure to check that if it's set as hidden in the name1_hide/name2_hide field, that it doesn't show)and put it all in one combo box.
I've edited the tables from my second post to show what I want.

Reply With Quote
  #7  
Old July 1st, 2009, 07:46 AM
rpeare rpeare is offline
Contributing User
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jan 2008
Posts: 1,093 rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level)rpeare User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 23 h 52 m 46 sec
Reputation Power: 227
Yes it is possible using a UNION query, however you want to be very careful with how you're storing the data you choose. If you are storing the value itself rather than the primary key on your form you will be ok but if you are using the primary key you will probably have to generate the ID yourself rather than relying on autonumber.

For instance if you have these two tables

Code:
Color_ID  Color_Desc
1         Yellow
2         Blue
3         Green


Code:
Shade_ID  Shade_Desc
1         Cyan
2         Turquoise
3         Cerulian


you can see if you make a union query out of this you're going to have two items that use the same unique identifier and it will make things extremely difficult on you if you are going to then go back and make a query and try to figure out which table the ID you stored is coming from.

The syntax for a union query for this example would be:
__________________
----------------
If we've helped you and you have solved your problem please post that it's been resolved so we know! The suspense kills me!

Reply With Quote
  #8  
Old July 1st, 2009, 02:35 PM
aznmaster aznmaster is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 34 aznmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 44 m 50 sec
Reputation Power: 1
Though it seems you're missing the code you were going to post.
I figured out how to do it using a UNION query.

Thank you very much.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Forms - Selective Display of a List of items into A Combo Box


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
Stay green...Green IT