Re: Listboxes results based on table joins

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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



.



Relevant Pages

  • Re: Listboxes results based on table joins
    ... Use the after update event of the listbox with questions, ... Dim strSQL as String ... Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia ... One has a list of questions and the other table lists ...
    (microsoft.public.access.formscoding)
  • Re: How to preserve CListbox contents between dialogs
    ... At this point the main problem I will have is sorting ... able to assign a listbox to multiple dialogs. ... for shorter lists, but those are so difficult to translate since the values ... In the dialog OnDestroy I set listbox parent to NULL ...
    (microsoft.public.vc.mfc)
  • Re: How to preserve CListbox contents between dialogs
    ... able to assign a listbox to multiple dialogs. ... for shorter lists, but those are so difficult to translate since the values ... CListBox contents are pretty much static, ... In the dialog OnDestroy I set listbox parent to NULL ...
    (microsoft.public.vc.mfc)
  • Re: Listboxes results based on table joins
    ... Here is my sql in the Row Source (for the second listbox that connects to ... Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia ...
    (microsoft.public.access.formscoding)
  • Re: Need some help on forms
    ... You know with buttons, labels, picture boxes, lists & stuff like that. ... WizardController class to act as the user process component that controls ... In the Form designer select a ListBox that you want to bind to a data ...
    (microsoft.public.dotnet.framework.adonet)