473,395 Members | 1,516 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,395 software developers and data experts.

limiting values in a list box that is based on another list box

I currently have three list boxes on my form, the information on each
one is determined on what was selected on the one before it. The
problem I'm having is the information that is used is pulled from
another program and is duplicated a lot.

Example

Type Make Model

Car Ford Mustang
Car Ford Focus
Car Dodge Neon
Truck Ford Ranger
Truck Ford F-150
In the first list box it would allow you to pick from Car or Truck, the
second list box would make you pick from Ford or Dodge, the problem I'm
running into is that Ford will come up twice in the list box and Dodge
once, I would like to limit it to only come up once. The code I'm
using in the row source for the list box is as fallows.

SELECT Products.ProductID, Products.Type, Products.Make FROM Products
WHERE (((Products.Type)=Forms![Bound Combo Form]!LstType)) ORDER BY
Products.Make;

This is not the information I'm actually using just an example. Any
help anybody could give me in limiting duplicate entries would be
greatly appreciated.

Mar 12 '06 #1
2 1466
i think u should make 3 query for ur problem

1. group by type
2. query where type car = first input
3. query where type car = first input, and where make = second input

hope this help u

Mar 12 '06 #2
Hi

Use SELECT DISTINCT in your query. It would work better to have 3
seperate queries:
For the 1st Listbox:
SELECT DISTINCT Products.Type FROM Products
WHERE (((Products.Type)=Forms![Bound Combo Form]!LstType))
For the 2nd Listbox you will select all makes that match the 1st query
For the 3rd Listbox you will select all nakes that match the 1st and
2nd query.

Mar 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jo Davis | last post by:
access fe and access be. later the be might be sql server I don't want people to pass this application around. And I want control over usage. I want it to 'expire' after a while. I have fairly...
2
by: Kathy | last post by:
Scenario: Multiple Divisions. Each Division has multiple Buildings. Each Building has multiple Floors. Each Floor has a Supervisor. Tables: (abbreviated) TblDivision DivisionID Division
2
by: AA Arens | last post by:
Somebody willing to assist me in the following? I want to have values from one field copied to another field when I choose choose a item from a drop down menu. I have 2 forms: 1 Company...
4
by: Fendi Baba | last post by:
I am creating a simple project information database. In the project information form 1 have two subforms. one contains organization involved - many organzation can be involved - and another list of...
7
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit...
6
by: Pavel Maly | last post by:
Hi, how do I access values in an ArrayList which is a part of another ArrayList? I know I can define a class and then it is quite simple, but this is just an auxiliary application to compute some...
2
by: gleadams | last post by:
I have databound a Windows form ComboBox control to a DataSource and DataMember and it is properly showing the data as I navigate through the records. My question concerns the choices in the...
0
by: AccessAcct | last post by:
I want to chart the values from a list box on my form without having to go back to the table holding the data, is this possible? I have a list box that has a user defined criteria, when it is set...
4
WyvsEyeView
by: WyvsEyeView | last post by:
I have a datasheet form in which one field is a combo box that will potentially contain hundreds of records. I've read about several methods of speeding up such combo boxes or limiting their initial...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.