Re: Listboxes results based on table joins

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



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: 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: How do I use a list box to update a record in a table
    ... The two text boxes are used to update the information, ... >>I have created a form bound to a query. ... >>automatically lists specific records based on criteria setup in the query. ... > - that is NOT a typical manner of using a listbox! ...
    (microsoft.public.access.forms)
  • 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)