Results 1 to 6 of 6
  1. #1
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Linking MultiSelect Listbox to SubForm (A2003 SP2)

    I have an unbound form that contains several multi select listboxes. Multiselect Listbox A and Multiselect Listbox B allow the users to make selections that drive the rowsource for Multiselect Listbox C. The user then makes selections in Multiselect Listbox C to populate data in another control.

    The issue is that the final control contains a text field (definitions) with some fields over 1000 characters in length. So, using another listbox does not look very good as it is hard to read.

    I am trying to have Multiselect Listbox C drive the datasource for the Subform but can't get it to work. I have tried it in code using a rowsource, created tables, etc., but to no avail. Any ideas? I was going to try a multipik selection list box but have never done one and was wondering if there is an easier way.

    I have also attached a stripped down copy of the database. The top two multil-selects drive the one below them which in turn would limit the subreport to show definitions on the terms selected.
    Regards,

    Gary
    (It's been a while!)

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Linking MultiSelect Listbox to SubForm (A2003 SP2)

    I got it. Couldn't remember the controls on the subform but did as follows to reset the recordsource on the subform.

    strsql = "SELECT DefTerm, Definition FROM T_MasterDefinition" _
    & " WHERE DefTerm In " & SelectListTermsString & ";"

    Me.T_MasterDefinition_subform.Form.RecordSource = strsql
    Regards,

    Gary
    (It's been a while!)

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Linking MultiSelect Listbox to SubForm (A2003 SP2)

    Boy I'm glad you figured it out - it would have taken days or weeks for me to sort though that.
    Wendell

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linking MultiSelect Listbox to SubForm (A2003 SP2)

    Instead of creating a temporary table, I would set the Record Source property of the subform to the appropriate SQL string. See attached version (I removed the unnecessary id fields from the tables).

    Added: oops, you figured it out yourself.

  5. #5
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Linking MultiSelect Listbox to SubForm (A2003 SP2)

    ... are you trying to imply that my post was unclear, hard to understand, and a bit confusing (as they always are) <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>

    Now the users want me to add somewhat of a fuzzy search (which I am quite fuzzy on) LOL - Time to search for some algorithms.
    Regards,

    Gary
    (It's been a while!)

  6. #6
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Linking MultiSelect Listbox to SubForm (A2003 SP2)

    Hans,

    Thanks for the help. I like the way your code is - much cleaner. ... and you even cleaned up the table structure view.

    Thanks again
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •