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 26th, 2009, 06:11 AM
lotsodata lotsodata is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 16 lotsodata User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 29 sec
Reputation Power: 0
Question Forms - 4 combo boxes

Hey all!
I am having issues with my database. I have searched the web hi and lo, but nothing that could help me, or that I could understand.
I'm designing a database, in which a few users will have to be able to enter and search for data. I've been doing good so far. have a enterform, searchform, searchbydateform, googlesearchform, navigationform.
All the information goes into one table, currenttable.
The search forms and entry forms are all run by query, which all works fine.
Here is my dilema:
The user has to enter a product group.
There are about 8 main groups, each of which has about 3-5 sub groups, each sub group has another 2-3 sub groups, and each of these sub groups has 5-6 sub groups.
So far i have 4 combo boxes, 'groupmain', 'groupsub', 'groupsub2', 'groupsub3'. I need the combo boxes to update the information, depending on which category was selected in the previous combo box. Example: If I select for 'groupmain' "automation and control systems" then combo box 'groupsub' should only list all systems for automation and control.
So far I have everything put into one table. I', not really sure, but i think i need multiple tables with keys? I've found a few examples of this being done with state / city combo boxes, but I can't really relate it to my table. Once I get this done, my database will be complete!!! I hope someone on here can save me from sitting in front of google unsuccesfully for another 3 days..

Reply With Quote
  #2  
Old June 26th, 2009, 07:35 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
This is called cascading combo boxes.

Let's say you have the following 2 tables:

Code:
Tbl_Items
Item_ID  Item_Name
1        Item Part 1
2        Item Part 2

Tbl_Sub_Items
Sub_Item_ID  Item_ID  Sub_Item_Name
1            1        Sub Item 1.1
1            2        Sub Item 1.2
2            1        Sub Item 2.1
2            2        Sub Item 2.2


Now let's say your form is called Frm_Test
Your First Combo box is called Fld_Test_Combo1
Your Second Combo box is called Fld_Test_Combo2

Your first combo box should store 2 columns with column 1 being your bound column (Item_ID). Your second combo box would based on a query where the criteria in the ITEM_ID column would be [Forms]![Frm_Test]![Fld_Test_Combo1].

Then in the ON CHANGE or ON EXIT property of the first combo box you'd have the command

me.fld_test_combo2.requery
__________________
----------------
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
  #3  
Old June 30th, 2009, 04:03 AM
lotsodata lotsodata is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 16 lotsodata User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 29 sec
Reputation Power: 0
ok cool. I was on the right track then. I had something like that set up before, but deleted it because i thought i was way off. What data type should i set the different fields to? and also, which fields would be the primary key? What i have now is a table with the main_groups and ID fields. There are 69 entry, but only 6 or 7 different Main_groups. Most are in there mutiple times, because there are 10 or so sub groups in each main group. I dont think i'm quite getting this
Is it possible to put a link to my database on here for someone to look at?

Reply With Quote
  #4  
Old June 30th, 2009, 07:47 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
A primary key is a field that is not repeated the fields you mentioned don't meet that criteria. The favored way to generate a primary key is to use the autonumber feature. It's quick and painless. If your tables do not use an autonumber feature I'd suggest changing the structure so that it does. It will probably involve making a new table and moving your existing data into the new table. In my example you'd need another field in the Tbl_Sub_Items with an autonumber and name it something like Combination_ID.

You can't post databases here until you reach a certain post count or time on the board but if you upload it to a file sharing website I will take a look.

Reply With Quote
  #5  
Old July 1st, 2009, 03:33 AM
lotsodata lotsodata is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 16 lotsodata User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 29 sec
Reputation Power: 0
I tried to follow your sample to the q. but its just not working for me. what columns do i need to include in the query that the second combo box is based on? Do I get to this query by going on row source in the 2nd combo box properties?
I found a bunch of samples online that all follow the format you gave, but somehow, i can't recreate them to work in my database. If you can take a look at this thing, i would be very grateful. whats a website i can share my database with?


Quote:
Originally Posted by rpeare
This is called cascading combo boxes.

Let's say you have the following 2 tables:

Code:
Tbl_Items
Item_ID  Item_Name
1        Item Part 1
2        Item Part 2

Tbl_Sub_Items
Sub_Item_ID  Item_ID  Sub_Item_Name
1            1        Sub Item 1.1
1            2        Sub Item 1.2
2            1        Sub Item 2.1
2            2        Sub Item 2.2


Now let's say your form is called Frm_Test
Your First Combo box is called Fld_Test_Combo1
Your Second Combo box is called Fld_Test_Combo2

Your first combo box should store 2 columns with column 1 being your bound column (Item_ID). Your second combo box would based on a query where the criteria in the ITEM_ID column would be [Forms]![Frm_Test]![Fld_Test_Combo1].

Then in the ON CHANGE or ON EXIT property of the first combo box you'd have the command

me.fld_test_combo2.requery

Reply With Quote
  #6  
Old July 1st, 2009, 04:44 AM
lotsodata lotsodata is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 16 lotsodata User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 29 sec
Reputation Power: 0
YEEEHA. never mind bro, i figured it out! So i got it to work for 2 combo boxes. anything special i need to do to make it work on 4, or just same procedure?

Reply With Quote
  #7  
Old July 1st, 2009, 05:55 AM
lotsodata lotsodata is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 16 lotsodata User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 29 sec
Reputation Power: 0
This must be my day! I just got all 4 to work together in harmony.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Forms - 4 combo boxes


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 6 Hosted by Hostway
Stay green...Green IT