[AccessD] Multi-Select List Box problems
df.waters at outlook.com
Sun Sep 5 13:18:10 CDT 2021
I've done this same thing too - it's simple and works well!
From: AccessD [mailto:accessd-bounces+df.waters=outlook.com at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: 5 September, 2021 10:06
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Multi-Select List Box problems
When I had this problem, I iterated through the listbox (you can do this
with just the selected items) and add create a WHERE clause MyField1 =
value OR MyField2 = value, etc. append that to the SQL of the query which
opens the recordset.
Crude but it works.
On Sun, Sep 5, 2021 at 6:59 AM Arthur Fuller <fuller.artful at gmail.com>
> Actually that description is slight inaccurate. Here is a brief overview of
> the situation:
> 1. A Customer has multiple Projects
> 2. A Project has multiple Workstations.
> 3. A workstation may have multiple issues
> Currently the code presents the user with a combo box to select the
> customer of interest. A multi-select list box presents the user with the
> Projects for the selected Customer. On clicking a Project the list bo
> x containing the Workstations for that Project. From there the user can
> print a report that lists the issues for one selected Workstation. It is
> written using a recordset that finds all the issues for one Worksation.
> I have been asked ti change the code so that multiple projects can be
> selected, and within those, multiple workstations can be selected. I
> changed the list boxes to multi-select, and a button on the form
> accumulates the Workstation IDs and turns them into a comma-separated list
> wrapped in a SQL IN() clause.
> and the multi-select code
> This all works fine. But I'm not sure how to bridge the gap between the
> recordset code, which was written originally to deal with only one
> Workstation at a time.
> I'm not tied to the SQL IN() approach. I've also considering using an array
> or a collection of Workstation IDs. One thing that occurred to me is to
> expand the recordset to include all the selected workstations rather than
> dealing with them one by one. One downstaream advantage is that the final
> report could do the whole thing in a single pass, and generate a single
> Any thoughts on this subject?
> Currently the code
> AccessD mailing list
> AccessD at databaseadvisors.com
> Website: http://www.databaseadvisors.com
AccessD mailing list
AccessD at databaseadvisors.com
More information about the AccessD