Results 1 to 4 of 4
  1. #1
    Brightspark98 is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2016
    Posts
    57

    Listbox filter

    Hi,


    I have a multi column listbox."data"
    Is it possible to filter the contents of column 3 based on multiple values from another listbox?
    Column 3 in the data listbox is headed "groups". The filter listbox holds the same info as column 3 in the data listbox. A,B,C,D,E,F etc.
    I want to be able to select for example A, D & F from the filter listbox & use it to filter the data listbox on a cmdbutton click.

    Hope this makes sense.
    Thanks

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Be aware, "Data" (and "Filter" if you used that as a listbox control name) are reserved words and shouldn't be used as object names.
    Also "Data" is not very descriptive. Better names would be "lstData" (list Data) and "lstFilter".

    Is it possible? Sure with some VBA programming.
    How strong are your VBA skills?


    Here is an example.....
    Attached Files Attached Files

  3. #3
    Brightspark98 is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2016
    Posts
    57
    Hi Steve,

    'Data' & 'Filter' were only used for this message and not in the db.

    Your code was excellent, just the job.

    Many thanks.

    Mark

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Glad you got it working.




    BTW, it is better to use actual object names than to confuse things by using made up names.........

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

Similar Threads

  1. Replies: 8
    Last Post: 03-05-2016, 10:39 AM
  2. Filter a form using a listbox
    By jrosen12 in forum Forms
    Replies: 3
    Last Post: 03-23-2015, 07:44 AM
  3. Filter listbox, using combo boxes
    By EthanMoist in forum Forms
    Replies: 8
    Last Post: 05-22-2013, 11:36 AM
  4. Filter Split Form using ListBox and .ME
    By clchris_80 in forum Access
    Replies: 3
    Last Post: 01-17-2013, 07:30 PM
  5. Set Listbox Filter w/ Multiple Textboxes
    By Ganymede in forum Forms
    Replies: 1
    Last Post: 01-13-2012, 04:02 AM

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