473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Cascading ComboBoxes

lee123
556 512MB
Hello its been a while since i have come to this web site and its been a while since i have done any programming but here i am. my question is going to be difficult to explain but here it goes. i have been trying to make a auto parts database but i cant get it to cascade the parts i need for certain cars and years.

in my database i have 6 Comboboxes on an unbound form each one drills down to the next one as it suppose to but when i change to a different make of a car i cant seem to get the parts to show up for that make.

as you may have guessed i have six tables.

Years - YearID, Year
Make - MakeID, YearID, Make
Model - ModelID, MakeID, YearID, Model
Engine - EngineID, YearID, MakeID, ModelID, Engine
ReplacementParts - ReplacementID, YearID, MakeID, ModelID, EngineID, ReplacementPart
Parts - PartsID, ReplacementPartsID, YearID, MakeID, ModelID, EngineID, Part, PartNumber

My Codes I Have behind Them Is This:


Expand|Select|Wrap|Line Numbers
  1. Private Sub EngineCombo_AfterUpdate()
  2.     ReplacementPartsCombo.RowSource = "SELECT ReplacementPartsID,YearID,MakeID,ModelID,EngineID,ReplacementPart FROM ReplacementPartsT WHERE YearID=" & EngineCombo
  3. End Sub
  4. Private Sub MakeCombo_AfterUpdate()
  5.     ModelCombo.RowSource = "SELECT ModelID,MakeID,YearID,Model FROM ModelT WHERE makeID=" & MakeCombo
  6.     ModelCombo.SetFocus
  7.     ModelCombo.Dropdown
  8. End Sub
  9. Private Sub ModelCombo_AfterUpdate()
  10.     EngineCombo.RowSource = "SELECT EngineID,YearID,MakeID,ModelID,Engine FROM EngineT WHERE MODELID=" & ModelCombo
  11.     EngineCombo.SetFocus
  12.     EngineCombo.Dropdown
  13. End Sub
  14. Private Sub ReplacementPartsCombo_AfterUpdate()
  15.     PartsCombo.RowSource = "SELECT PartsID,ReplacementPartsID,YearID,MakeID,ModelID,EngineID,Parts,PartNumber,Price,Core,Store,Phone,City,State FROM PartsT WHERE  EngineID=" & ReplacementPartsCombo
  16. End Sub
  17. Private Sub YearCombo_AfterUpdate()
  18.     MakeCombo.RowSource = "SELECT MakeID,YearID,Make FROM MakeT WHERE YearID=" & YearCombo
  19.     MakeCombo.SetFocus
  20.     MakeCombo.Dropdown
  21. End Sub
If you someone can take the time and look at this and see if you can help me out i would appriciate it very much. Oh I Am using Access 2000 Developers

lee123
Oct 18 '11 #1
3 955
NeoPa
32,556 Expert Mod 16PB
You should find something to help with this in Cascaded Form Filtering.
Oct 18 '11 #2
lee123
556 512MB
Thanks You I'll Try This..
Oct 19 '11 #3
NeoPa
32,556 Expert Mod 16PB
8-). Have a real play around with the illustration database. I expect once you've explored a bit you'll find you can adapt the concepts to your own database quite straightforwardly (but if you have any problems still then let us know here and we'll do what we can for you of course).
Oct 19 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: cognoscento | last post by:
I'm currently putting together a database for my work (not an expert by any stretch, so muddling through as best as I can... you know the story...) and I could use some advice and hand-holding ...
4
by: pmcguire | last post by:
I have 2 bound ComboBoxes. I want the datasource of the second to be limited by the selection made in the first. I can do this by responding to the SelectionIndexChanged event on the first, but...
6
by: visionstate | last post by:
Hi there, I am building a database that requires cascading lists on a form. I currently have (I may be adding more later) 3 combo boxes on my form - Department, Surname and Forename. The user...
7
by: Iyhamid | last post by:
Filling A Combo Box2 (filed2) with Combo Box1 (Filed1) After Update filed 1 -------------------------------------------------------------------------------- I Have 2 combo boxes with 2 diffrent...
19
by: Amanduh | last post by:
Hi again, brilliant developers. I'm having serious issues with cascading comboboxes. I had it working perfectly before, but then was asked to add an additional variable and everything went haywire...
4
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database. The tables that pertain to this issue are tblOrg, tblState, tblCity, and tblZip. I have posted the table structure with only the pertinant fields...
6
Walt in Decatur
by: Walt in Decatur | last post by:
I have implemented successfully a single-cascade ComboBox combination on a form in my database (using an AfterUpdate event code). I have also successfully implemented a ComboBox + TextBox...
16
by: Tarheel | last post by:
...You're fast! I appreciate that. Thanks! I look forward to your explanation. One last problem I have on my form is getting all of my comboboxes to update each other. I know how to update...
3
by: AccessBeetle | last post by:
I have a table called tblLocationInfo which has field like I have a form which has a subform and this subform has all these county, township and quad comboboxes based on the look up tables(ex...
3
by: AccessBeetle | last post by:
I have a form which shows a search results based on certain parameters. This form has a subform which has three cascading comboxes, County, Township and Quadmaps. Township and Quadmap should show...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.