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 / Forms / October 2005

Tip: Looking for answers? Try searching our database.

multi-select filters report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
r - 14 Oct 2005 22:09 GMT
Can someone point me to a good article or tutorial on how this works?

I have a listbox on a "menu" like form.  The user can select one or many
names in the list, then click a button which will open a report displaying
the details for only the IDs selected in the listbox.

And for that matter, I'd like to make a "select all" and "unselect all"
button since I've got a bazillion entries in the list.  A pointer for that
would be great, too, if there is one.

Thanks again.
Allen Browne - 15 Oct 2005 05:21 GMT
Loop through the ItemsSelected collection of the unbound multi-select list
box, to build up the WhereCondition of the OpenReport.

Details and example code in this article:
   Use a multi-select list box to filter a report
at:
   http://allenbrowne.com/ser-50.html
If no items are selected, the WhereCondition will be blank, and so all items
will be shown in the report.

The code below clears all selections in the list box:

Function ClearList(lst As ListBox) As Boolean
On Error GoTo Err_ClearList
   'Purpose:   Unselect all items in the listbox.
   'Return:    True if successful
   Dim varItem As Variant

   If lst.MultiSelect = 0 Then
       lst = Null
   Else
       For Each varItem In lst.ItemsSelected
           lst.Selected(varItem) = False
       Next

   End If

   ClearList = True

Exit_ClearList:
   Exit Function

Err_ClearList:
   MsgBox "Error " & Err.Number & " - " & Err.Description
   Resume Exit_ClearList
End Function

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

> Can someone point me to a good article or tutorial on how this works?
>
[quoted text clipped - 7 lines]
>
> Thanks again.
 
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.