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, 05: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, 06:35 AM
rpeare rpeare is offline
Contributing User
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jan 2008
Posts: 1,094 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 54 m 49 sec
Reputation Power: 228
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, 03: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, 06:47 AM
rpeare rpeare is offline
Contributing User
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jan 2008
Posts: 1,094 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 54 m 49 sec
Reputation Power: 228
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, 02: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, 03: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, 04: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!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

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





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 8 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek