Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

criteria from multiselection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
angie - 28 Feb 2008 14:38 GMT
i have a form with a multiselect list. i want my query to return records
based on the multiple selections. how can i achieve that?

i have tried [forms]![formname]![listname] but i get no data.
Allen Browne - 28 Feb 2008 14:47 GMT
You cannot directly use a multi-select list box like that in a query.

You will need to loop through the ItemsSelected collection of the listbox.
It is possible to write a function that accepts the field value and the list
box and returns True/False as to whether it was found, and use this function
in the WHERE clause of a query.

However, it's probably easier to build a Filter for your form or report from
the ItemsSelected. Here's an example of how to do that:
   Use a multi-select list box to filter a report
at:
   http://allenbrowne.com/ser-50.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>i have a form with a multiselect list. i want my query to return records
> based on the multiple selections. how can i achieve that?
>
> i have tried [forms]![formname]![listname] but i get no data.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.