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

Successive Queries with Value Lists

I'm trying to develop a query where each successive query filters the
options for the next. Optimally the user will select the value from a
list of options, which will then create the value list of options for
the next query.

Nov 13 '05 #1
5 1615
DFS
dvorett wrote:
I'm trying to develop a query where each successive query filters the
options for the next. Optimally the user will select the value from a
list of options, which will then create the value list of options for
the next query.


This auto example might get you started - though it doesn't use Value Lists
for the rowsources. For Value Lists, you'll need to open and iterate
through recordsets based on earlier queries, add values to strings, and set
the list rowsources to the strings.

1st query, in listbox listMakes:
SELECT Make
FROM Makes
ORDER BY Make;

2nd query, in listbox listModels:
SELECT Model
FROM MakesModels
WHERE Make = FORMS.formName.listMakes
ORDER BY Model;

3rd query, in listbox listOptions:
SELECT Option FROM MakesModelsOptions
WHERE Make = FORMS.formName.listMakes
AND Model = FORMS.formName.listModels
ORDER BY Option;

In the AfterUpdate event of listMakes, add the lines:
Me.listModels.Requery
me.listOptions.requery

In the AfterUpdate event of listModels, add the line:
Me.listOptions.Requery


Nov 13 '05 #2
Thanks so much. That really put me on the right track. I'm still
having trouble with the best way to set up the table though. The query
asks for a location, a goal, and an objective and spits out management
practices to achieve them. However, often times there will be several
goals for one location, several objectives per goal and several
practices per objective and the list box will display all instances of
"Stream Bank Hardening" in objective for example. I tried splitting
the information into separate tables and then linking them all by id #
in a fourth table (Tbl_unit, Tbl_goal, Tbl_objective and tbl_link) but
now I'm having trouble filtering the second listbox with the input from
the first. Any suggestions you could pass along would be much
appreciated.
Thanks
Dan

Nov 13 '05 #3
Thanks for the help, its definitely put me on the right track although
I am still having some trouble setting up the tables so that the
information is displayed in the list boxes the way that I want. The
user selects a location, a goal, and an objective and a report is
previewed with restoration practices that will achieve those goals.
However, there are many instances of each location, goal, and objective
so the listbox will display each entry several times. When I break up
the table into 4, tbl_location with fields (ID and location) goal with
fields(ID and goal) objective with fields (ID and objective) and a
table that links all the IDs with restoration practice ID I dont see a
way that I can filter the second listbox by the results of the first.
Any suggestions that you could pass along would be greatly appreciated.

Thanks a bunch
Dan

Nov 13 '05 #4
Thanks so much. That really put me on the right track. I'm still
having trouble with the best way to set up the table though. The query
asks for a location, a goal, and an objective and spits out management
practices to achieve them. However, often times there will be several
goals for one location, several objectives per goal and several
practices per objective and the list box will display all instances of
"Stream Bank Hardening" in objective for example. I tried splitting
the information into separate tables and then linking them all by id #
in a fourth table (Tbl_unit, Tbl_goal, Tbl_objective and tbl_link) but
now I'm having trouble filtering the second listbox with the input from
the first. Any suggestions you could pass along would be much
appreciated.
Thanks
Dan

Nov 13 '05 #5
Thanks for the help, its definitely put me on the right track although
I am still having some trouble setting up the tables so that the
information is displayed in the list boxes the way that I want. The
user selects a location, a goal, and an objective and a report is
previewed with restoration practices that will achieve those goals.
However, there are many instances of each location, goal, and objective
so the listbox will display each entry several times. When I break up
the table into 4, tbl_location with fields (ID and location) goal with
fields(ID and goal) objective with fields (ID and objective) and a
table that links all the IDs with restoration practice ID I dont see a
way that I can filter the second listbox by the results of the first.
Any suggestions that you could pass along would be greatly appreciated.

Thanks a bunch
Dan

Nov 13 '05 #6

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

Similar topics

2
by: sinan | last post by:
Hi I would like to make successive posts (queries) to a web page. To do this I use fsockopen() as many times as the number of posts. But I guess that this may be done via only one socket. Is this...
0
by: Morten Gulbrandsen | last post by:
Dear mysql users, in the tutorial of the documentation I found an interesting example of a complicated non trivial sql query: URL:...
2
by: Arpan | last post by:
An ASP application retrieves the DISTINCT records from all the columns of a SQL Server DB table & populates them in drop-down lists. The no. of drop-down lists on the web page depends upon the no....
8
by: Ian Davies | last post by:
Hello I am trying to run a few INSERT queries only if the user clicks 'continue' in a <a href> The queries takes variables created from SELECT queries. I have tried to acheive this by putting The...
5
by: Steve Patrick | last post by:
Hi All You guys are my last hope, despite spending money on books and hours reading them I still can not achieve the results I need. I have designed a database in Access 2000 based on 1 table,...
5
by: Jerry Hull | last post by:
I'm working with a database developed by an untrained person over several years - and on a network that has recently been upgraded with a new server installed and MS office upgraded from 2K (I...
2
by: hikmaz | last post by:
I am trying to get the rightmost digits (%10) of a number (taken from the user) and store it into successive array locations and get rid of the rightmost digit (\10) to store the next and so on and...
5
by: JasonP | last post by:
I am using Access 2003 on Windows XP. I am looking to analyse web traffic files using this - I appreciate there are bespoke applications which will do the same task. Each month there are roughly...
1
by: JosAH | last post by:
Greetings, Introduction This week we start building Query objects. A query can retrieve portions of text from a Library. I don't want users to build queries by themselves, because users make...
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: 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: 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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.