Results 1 to 3 of 3
  1. #1
    projectpupil7 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    37

    combo to filter subform from another subform

    Hi All,

    Main form frmSiteDetails

    frmRooms (subform) holds Room information for the rooms on each floor. This form has LinkMasterField [SlaveFloorsID] and LinkChildFields [FloorsID]

    frmFloors subform holds floor information for each floor in a property. This form has LinkMaster [SiteID] and LinkChildFields [SiteID]

    Both these forms sit on a Tab Control (TabCtl57) and do work properly.

    What I would like to do is to also have a Combo to pick a floor number from frmFloors and filter frmRooms. Both these forms have FloorsID fields. This would save a user having to go back to frmFloors to pick a different floor and then go back to frmRooms to view the room data for the new chosen floor.



    I am searching for a solution at the moment but haven't yet found one.

    Could someone help me to code this or perhaps point me to an example.

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    the sub forms each have a record source (table or query) - a query can have a criteria which determines which records are in the query result. good so far?


    that criteria can be called from a field in an open form i.e. Forms!SiteDetails.ComboboxName


    the sub forms will not inherently know when the combobox (criteria for their record source) changes - so you must trigger the sub forms to requery in the AfterUpdate Event of the combobox i.e.: Forms!frmRooms.requery


    these are the principals around what you seek.

  3. #3
    projectpupil7 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    37
    All the subforms are actually based on their tables.
    At present i have cboChangeFloor sitting on the Main form frmSiteDetails. The combo is based on a query qryChangeFloorNumber, the combo displays correctly.
    On frmRooms i have a field called FloorsID with a default value from =[Forms]![frmSiteDetails]![cboChangeFloor]. If i now change the combo i am getting "can't find frmRooms". This is in the AfterUpdate of the combo Forms!frmRooms.requery.

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

Similar Threads

  1. Combo box to filter records in a subform
    By dannybeaver in forum Access
    Replies: 9
    Last Post: 08-27-2014, 02:14 AM
  2. Replies: 9
    Last Post: 07-03-2014, 12:00 PM
  3. Filter a Subform with 4 combo box
    By Tlegendz8 in forum Forms
    Replies: 1
    Last Post: 05-20-2014, 03:06 PM
  4. Filter Subform by Combo Box Dates
    By steve042 in forum Forms
    Replies: 14
    Last Post: 06-20-2013, 07:36 AM
  5. Replies: 19
    Last Post: 07-23-2012, 10:34 AM

Tags for this Thread

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