• Linking MultiSelect Listbox to SubForm (A2003 SP2)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Linking MultiSelect Listbox to SubForm (A2003 SP2)

    Author
    Topic
    #431365

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #1009628

      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

      • #1009629

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

        • #1009633

          … are you trying to imply that my post was unclear, hard to understand, and a bit confusing (as they always are) dizzy

          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.

    • #1009632

      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.

      • #1009635

        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

    Viewing 1 reply thread
    Reply To: Linking MultiSelect Listbox to SubForm (A2003 SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: