Results 1 to 8 of 8
  1. #1
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79

    how do you show the Filtered Listbox1 from form A to listbox 2 form b

    Hi everyone,



    as you can see from my question i want to ask how do you show the Filtered Listbox1 from form A to listbox 2 form b, is it feasible. i know how to copy the value from listbox one to listbox 2, but can a filtered listbox1 results be shown into listbox 2.

    here is how the listbox1 is copied to listbox 2. note both listbox are in different forms

    [Forms]![formB]!
    [listbox2]=[Forms]![formA]!
    [listbox1]




    thanks for your help

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    If the list box row source is a table/query, add the Forms!Form!Listbox1 (multiselect not allowed) to the criteria row of the appropriate field of row source of Listbox 2.

  3. #3
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79
    thank you for your time,

    could you please give me an example, i understand what the criteria is, is it some thing like

    Me.lstListbox.RowSource = "SELECT [table].[RNumber],[table].[Rtype],[table].[RPrice] " & _"FROM table LEFT JOIN Booked ON [table].[RNumber] = Booked.RNumber " & _
    "WHERE [Booked].[RNumber] Is Null "
    [Forms]![formA]!lstListbox.Requery
    this is in form A where listbox1 is successfully filtered.
    with the same rowsource, the listbox 2 appropriate record is selected on form b. i want whatever filtered in form A to be shown in form b.


    thanks a lot

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Something like this
    Me.lstListbox.RowSource = "SELECT [table].[RNumber],[table].[Rtype],[table].[RPrice] " & _"FROM table LEFT JOIN Booked ON [table].[RNumber] = Booked.RNumber " & _
    "WHERE [SomeField] " & [Forms]![formA]!lstListbox " & " AND [SomeMoreField] IS Not Null;"

  5. #5
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79
    it not working, and my form A listbox becomes empty, should i send you an attachment so you can see, if it ok.

    thanks

  6. #6
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    zip and attach it here

  7. #7
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79

    attached zip file

    here is the attached file, thank you
    Last edited by princess12; 03-30-2015 at 04:41 PM.

  8. #8
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79
    Hi thanks for your help, but i fixed it, thank you very much

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

Similar Threads

  1. Replies: 2
    Last Post: 12-13-2014, 08:52 PM
  2. Filtered Report from filtered datasheet form
    By gemadan96 in forum Reports
    Replies: 7
    Last Post: 01-03-2014, 05:12 PM
  3. Open Report filtered by Date in ListBox
    By TinaCa in forum Programming
    Replies: 1
    Last Post: 03-06-2012, 02:29 PM
  4. Replies: 1
    Last Post: 07-30-2011, 03:21 PM
  5. Sub form filtered by listbox
    By BorisGomel in forum Forms
    Replies: 3
    Last Post: 05-04-2011, 09:20 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