Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 12th, 2006, 04:15 AM
wcrackshot78
Guest
 
Posts: n/a
Default 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.

  #2  
Old March 12th, 2006, 04:35 AM
baonks@gmail.com
Guest
 
Posts: n/a
Default Re: limiting values in a list box that is based on another list box

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

  #3  
Old March 12th, 2006, 08:05 AM
Hansen
Guest
 
Posts: n/a
Default Re: limiting values in a list box that is based on another list box

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.

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles