Re: Listboxes results based on table joins
- From: prog <prog@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Oct 2008 20:13:01 -0700
Ok. So, I'm setting the rowsource to what you have described, but everytime
i run the form it asks me to Enter a Parameter value.
Here is my sql in the Row Source (for the second listbox that connects to
the first listbox):
SELECT Answer FROM tblAnswers WHERE join_field=Me.List1;
Do I have the syntax correct for Me.List1? Should there be any special
characters around it?
"Jeanette Cunningham" wrote:
I seem to be missing the point of your difficulty..
And I do remember how difficult it was when I first started with cascading
combos and list boxes.
I will try to give an example.
Suppose you were trying to sort out countries, states and cities (please
ignore the fact of cities with the same name in different states for this
example).
The first combo would allow user to select a country.
The 2nd combo only shows the cities that are in the country selected in the
1st combo.
The 2nd combo would see the value of the ID of the Country from the 1st
combo.
The 2nd combo would use a where clause something like:
"Where [CountryID] = " & Me.Combo1& ""
in the query that makes the row source for the 2nd combo.
On to the 3rd combo.
The 3rd combo looks at the 2nd combo to see which value for city was chosen.
The 3rd combo has a where clause something like:
"Where [CityID] = " & Me.Combo2 & ""
in the query that makes the row source for the 3rd combo.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"prog" <prog@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B6D52254-C1B5-47FE-86F8-C56716125024@xxxxxxxxxxxxxxxx
I guess my question is then, How do I define the row source for the 3rd
list
box based on the values of the second box (which are based on the first)?
Should I use syntax like the following for the row source in the third
listbox: Me.[listbox2].Requery ??
"Jeanette Cunningham" wrote:
It is the same process whether 2, 3, 4 or more cascading combos or list
boxes.
The 3rd list box has its row source filtered by the item selected in the
2nd
list box.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"prog" <prog@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F42535F6-B723-448D-9E13-B9334BB7EB2C@xxxxxxxxxxxxxxxx
Ok. I was able to get that to work. Now I'm running into some issues
when I
try to create a third listbox which returns results based on the second
one.
"Jeanette Cunningham" wrote:
Hi prog,
this is similar to creating cascading combo boxes.
Use the after update event of the listbox with questions, to build the
row
source for the listbox with answers.
A simple example would be something like this:
Dim strSQL as String
strSQL = "Select AnswerID, AnswerDescr " _
& "From tblAnswer " _
& "Where QuestionID = " & Me.[NameOfQuestionListbox] & " " _
& "Order by AnswerDescr"
Me.[NameOfAnswerListbox].Rowsource = strSQL
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"prog" <prog@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:20C871B1-7017-4749-9858-5A8DEA65C1D8@xxxxxxxxxxxxxxxx
Hi,
I have two tables. One has a list of questions and the other table
lists
answers to those questions. It's a one to many (one question many
answers).
What I'm trying to do is have a list box list all the questions,
which
I
already have and then based on the question I pick (onclick) a
second
listbox
appears showing me specific answers to that question. And I already
have
this created via joins between the two tables in the background.
Thanks
- Follow-Ups:
- Re: Listboxes results based on table joins
- From: John W . Vinson
- Re: Listboxes results based on table joins
- References:
- Listboxes results based on table joins
- From: prog
- Re: Listboxes results based on table joins
- From: Jeanette Cunningham
- Re: Listboxes results based on table joins
- From: prog
- Re: Listboxes results based on table joins
- From: Jeanette Cunningham
- Re: Listboxes results based on table joins
- From: prog
- Re: Listboxes results based on table joins
- From: Jeanette Cunningham
- Listboxes results based on table joins
- Prev by Date: Re: "Invalid use of Null" issue
- Next by Date: Re: Listboxes results based on table joins
- Previous by thread: Re: Listboxes results based on table joins
- Next by thread: Re: Listboxes results based on table joins
- Index(es):
Relevant Pages
|