Results 1 to 2 of 2
  1. #1
    Khatru is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    5

    Selecting Just One List Box

    I have three list boxes in the form “Detail InstructorForm”. Thelist boxes are: SegmentList, TermList and Yearly list. I want to be able to select differentcriteria to generate a report based on these listboxes. I would also like to select just one list boxto gather information from that criteria. (So if I want just yearly data I canselect the year that I want and generate a report that will provide informationfrom that year only). Everything works exceptwhen I try to run the report on just one list box. I do not get any data when I run the reportfrom one listbox. Below is the code I put in the query as well as the codeI put in the After Update field of the buttons for each list box.
    Like [Forms]![DetailInstructorForm]![SegmentList] &"*" Or Is Null
    Like [Forms]![DetailInstructorForm]![TermList] &"*" Or Is Null
    Like [Forms]![DetailInstructorForm]![YearlyList] &"*" Or Is Null

    Private Sub Option101_Click()


    Dim i As Integer
    10 For i = 0 To Me.TermList.ListCount - 1
    20 Me.TermList.Selected(i) = False
    30 Next i
    End Sub
    Private Sub Option103_Click()
    Dim i As Integer
    10 For i = 0 To Me.YearlyList.ListCount - 1
    20 Me.YearlyList.Selected(i) = False
    30 Next i
    End Sub
    Private Sub Option99_Click()
    Dim i As Integer
    10 For i = 0 To Me.SegmentList.ListCount - 1
    20 Me.SegmentList.Selected(i) = False
    30 Next i
    End Sub
    Any thoughts?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Wasn't this solved in your other thread? https://www.accessforums.net/forms/u...xes-51346.html

    Why is there a 'button' for each listbox?

    Why do you need code that unselects listbox items?

    Are these multi-select listboxes? Multi-select will not work with the dynamic query parameters.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 11-24-2014, 02:20 PM
  2. Selecting items in multi-select list box
    By chronister in forum Access
    Replies: 3
    Last Post: 08-25-2013, 03:33 AM
  3. Replies: 5
    Last Post: 08-02-2012, 09:44 AM
  4. Replies: 9
    Last Post: 09-16-2011, 03:52 PM
  5. Replies: 1
    Last Post: 11-11-2006, 08:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums