Refer to multiple columns in Multi Select

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terri

    Refer to multiple columns in Multi Select

    Hi,

    I'm using the following code to build a concatenated string from a
    multi-select combo.

    For Each varItem In Forms!frmreport s!Combo1.ItemsS elected
    strSQL = strSQL & Forms!frmreport s!Combo1.ItemDa ta(varItem) & " OR
    [ID]="
    Next varItem

    This retrieves the values form the first column in the multi-select. How do
    I retrieve the second column which is not a numeric ID but a text field?

    Thanks



  • Steve Jorgensen

    #2
    Re: Refer to multiple columns in Multi Select

    On Tue, 27 Jan 2004 13:48:59 -0700, "Terri" <Terri@spamaway .com> wrote:
    [color=blue]
    >Hi,
    >
    >I'm using the following code to build a concatenated string from a
    >multi-select combo.
    >
    >For Each varItem In Forms!frmreport s!Combo1.ItemsS elected
    > strSQL = strSQL & Forms!frmreport s!Combo1.ItemDa ta(varItem) & " OR
    >[ID]="
    >Next varItem
    >
    >This retrieves the values form the first column in the multi-select. How do
    >I retrieve the second column which is not a numeric ID but a text field?
    >
    >Thanks
    >
    >[/color]

    Just use Column instead of ItemData. Pass the column number you want as the
    first argument (first column is number 0), and pas varItem as the second
    parameter.

    Comment

    • Terri

      #3
      Re: Refer to multiple columns in Multi Select

      Thanks Steve, Can you give a code example.
      thanks again

      "Steve Jorgensen" <nospam@nospam. nospam> wrote in message
      news:rakd10198k gdb01bb74nloh9i op3j5s7tf@4ax.c om...[color=blue]
      > On Tue, 27 Jan 2004 13:48:59 -0700, "Terri" <Terri@spamaway .com> wrote:
      >[color=green]
      > >Hi,
      > >
      > >I'm using the following code to build a concatenated string from a
      > >multi-select combo.
      > >
      > >For Each varItem In Forms!frmreport s!Combo1.ItemsS elected
      > > strSQL = strSQL & Forms!frmreport s!Combo1.ItemDa ta(varItem) & "[/color][/color]
      OR[color=blue][color=green]
      > >[ID]="
      > >Next varItem
      > >
      > >This retrieves the values form the first column in the multi-select. How[/color][/color]
      do[color=blue][color=green]
      > >I retrieve the second column which is not a numeric ID but a text field?
      > >
      > >Thanks
      > >
      > >[/color]
      >
      > Just use Column instead of ItemData. Pass the column number you want as[/color]
      the[color=blue]
      > first argument (first column is number 0), and pas varItem as the second
      > parameter.[/color]


      Comment

      • Steve Jorgensen

        #4
        Re: Refer to multiple columns in Multi Select

        OK, based on the code you provided...

        With Forms!frmreport s!Combo1
        For Each varItem In .ItemsSelected
        strSQL = strSQL & .ItemData(varIt em) & " OR [ID]="
        strItemTextList = _
        strItemTextList & .Column(1, varItem) & ", "
        Next varItem
        End With

        On Tue, 27 Jan 2004 14:03:42 -0700, "Terri" <Terri@spamaway .com> wrote:
        [color=blue]
        >Thanks Steve, Can you give a code example.
        >thanks again
        >
        >"Steve Jorgensen" <nospam@nospam. nospam> wrote in message
        >news:rakd10198 kgdb01bb74nloh9 iop3j5s7tf@4ax. com...[color=green]
        >> On Tue, 27 Jan 2004 13:48:59 -0700, "Terri" <Terri@spamaway .com> wrote:
        >>[color=darkred]
        >> >Hi,
        >> >
        >> >I'm using the following code to build a concatenated string from a
        >> >multi-select combo.
        >> >
        >> >For Each varItem In Forms!frmreport s!Combo1.ItemsS elected
        >> > strSQL = strSQL & Forms!frmreport s!Combo1.ItemDa ta(varItem) & "[/color][/color]
        >OR[color=green][color=darkred]
        >> >[ID]="
        >> >Next varItem
        >> >
        >> >This retrieves the values form the first column in the multi-select. How[/color][/color]
        >do[color=green][color=darkred]
        >> >I retrieve the second column which is not a numeric ID but a text field?
        >> >
        >> >Thanks
        >> >
        >> >[/color]
        >>
        >> Just use Column instead of ItemData. Pass the column number you want as[/color]
        >the[color=green]
        >> first argument (first column is number 0), and pas varItem as the second
        >> parameter.[/color]
        >[/color]

        Comment

        Working...