Results 1 to 5 of 5
  1. #1
    vazdajic is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    95

    Filtering Subform CBO based on Main Form CBO state


    Hi everyone.

    I need some help to filter CBO on a Subform, based on Main Form CBO state.

    Below, I have attached a printscreen of the challenge I have and DB in ZIP format.

    Any help/suggestion is welcome.

    Thanks everyone.

    Click image for larger version. 

Name:	Forum_05.jpg 
Views:	16 
Size:	281.4 KB 
ID:	45653

    WWV_Calculations_04.07.2021-07.zip

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,568
    Change the rowsource of the combo in the afterupdate event of that control in the main form.?
    https://docs.microsoft.com/en-us/off...obox.rowsource
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    This sql will restrict the combo Description to those records where
    the subform Kataloge_Name = the KatalogName in the parent form

    (tbl_Alle_Kataloge.Katalog_Name)=[Forms]![frm_Arb_Paket].[Katalogname])


    Modify the rowsource of the combo to


    Code:
    SELECT tbl_Alle_Kataloge.AlleKatalogeID, tbl_Alle_Kataloge.GroupID
    , tbl_Alle_Kataloge.Description, tbl_Alle_Kataloge.Unit_Time
    , tbl_Alle_Kataloge.Size, tbl_Alle_Kataloge.Unit, tbl_Alle_Kataloge.Katalog_Name
    FROM tbl_Alle_Kataloge
    WHERE 
    (((tbl_Alle_Kataloge.GroupID)=[Forms]![frm_Arb_Paket]![subform_Kalkulationen]![GroupID]) 
    AND 
    ((tbl_Alle_Kataloge.Katalog_Name)=[Forms]![frm_Arb_Paket].[Katalogname]));
    Attached Thumbnails Attached Thumbnails DescriptionRequested.jpg  
    Last edited by orange; 07-04-2021 at 11:23 AM.

  4. #4
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,822
    Hi
    Change the Row Source for the Description Combobox to this:-

    Code:
    SELECT tbl_Alle_Kataloge.AlleKatalogeID, tbl_Alle_Kataloge.GroupID, tbl_Alle_Kataloge.Description, tbl_Alle_Kataloge.Unit_Time, tbl_Alle_Kataloge.Size, tbl_Alle_Kataloge.Unit, tbl_Alle_Kataloge.Katalog_Name
    FROM tbl_Alle_Kataloge
    WHERE (((tbl_Alle_Kataloge.GroupID)=[Forms]![frm_Arb_Paket]![subform_Kalkulationen]![GroupID]) AND ((tbl_Alle_Kataloge.Katalog_Name)=[Parent]![KatalogName]));
    Sorry Orange has provided the same answer as me

  5. #5
    vazdajic is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    95
    Hi Mike.. Thank you so much..

    Although, Orange has provided the same (as you say), this is what I wanted.. As I am novice here, I'm pretty sure I would have messed something up while applying the instructions Orange has provided LOL.. Luckily, dummies like me have guys like you to help.

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

Similar Threads

  1. Replies: 39
    Last Post: 07-28-2018, 12:27 PM
  2. Opening a main form by filtering from subform
    By squeezelit in forum Forms
    Replies: 1
    Last Post: 02-03-2016, 04:08 PM
  3. Field in the main form based on a subform
    By azhar2006 in forum Forms
    Replies: 4
    Last Post: 03-08-2014, 11:24 PM
  4. Replies: 1
    Last Post: 10-10-2012, 03:33 PM
  5. Replies: 14
    Last Post: 03-07-2012, 03:46 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