[AccessD] Extended Combobox Questions

Stuart McLachlan stuart at lexacorp.com.pg
Sat Jul 3 16:24:15 CDT 2021


How do you create a multi-select combobox? I've never seen a combobox in Access that has 
a multi-select property.

OTOH, multi-select is a standard property of listboxes.

You can just step through the list and build your string with something like:

Dim strCriteria As String
Dim x As Long
For x = 0 To List1.ListCount - 1
        If List1.Selected(x) Then
            strCriteria = strCriteria & "," & List1.Column(0, x)
        End If
    Next
strCriteria = "IN (" & Mid$(strCriteria, 2) & ")"
MsgBox strCriteria

On 3 Jul 2021 at 16:06, Arthur Fuller wrote:

> Jack,
> Thanks, but  I have a question: Why do you prefer a listbox rather
> than a combobox? What are the disadvantages to a combo rather than a
> list? I have no preference either wa. I used to have code that did
> precisely what I need, but even backup hard disks die. I think I got
> the original code from Ken Getz's book but now can't find either the
> code nor the book.
> 
> 
> On Sat, Jul 3, 2021 at 11:33 AM Ryan W <wrwehler at gmail.com> wrote:
> 
> > I can´t help with point 1 but I use Allen Browne´s concatrelated
> > function often when I´m building a query with an IN() clause.
> >
> > http://allenbrowne.com/func-concat.html
> >
> > Sent from my iPhone
> >
> > > On Jul 3, 2021, at 10:24 AM, Arthur Fuller
> > > <fuller.artful at gmail.com>
> > wrote:
> > >
> > > 1,The combobox has two columns, the first being the PK of the
> > > row in the source row in the table, the second a text description.
> > > The user may select several items, or even all of them.  I refer
> > > to the selected
> > items?
> > > 2. I want to concatenate the PKs selected for use in the In()
> > > clause of a SQL statement. Given that they are numeric, is it
> > > enough just to wrap
> > them
> > > in STR() calls?
> > >
> > > --
> > > Arthur
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> 
> 
> -- 
> Arthur
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list