Results 1 to 5 of 5
  1. #1
    Bcanfield83 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    81

    Question Display Subform Based Upon Option Button Selection

    I have a form that contains 2 option buttons (radio buttons) within the header section. These are part of an Option Group - so the option values are simply "1" or "2" depending on which button is selected.
    In the main 'detail' section of the form is a Subform Container called "SubformContainer" (real creative I know).
    I'm trying to design it so that, depending on which of those 2 option buttons is selected, the appropriate form will be displayed in that Subform Container portion.


    This seems fairly simple, but for some reason it's not working.. No matter which option button is selected, the detail section of the form is blank.
    Thoughts?

    Code:
    Private Sub frameProjectOptions_AfterUpdate()
    
    
    Select Case Me.frameProjectOptions.Value
    
    
    Case 1
        Me.SubformContainer.SourceObject = "frmEDG_Project_Management_Subform_New"
    Case 2
       Me.SubformContainer.SourceObject = "frmEDG_Project_Management_Subform_All"
    
    
    End Select
    
    
    
    
    End Sub

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    I suggest you post a copy of your evolving database so readers can see what you are dealing with.

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    As an alternative I suggest you have two subforms placed in the same location and both hidden by default.
    Then make the relevant form visible depending on the option clicked
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    Bcanfield83 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    81
    Quote Originally Posted by ridders52 View Post
    As an alternative I suggest you have two subforms placed in the same location and both hidden by default.
    Then make the relevant form visible depending on the option clicked
    Thanks - that worked.

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    You're welcome
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 4
    Last Post: 10-23-2017, 06:36 AM
  2. filter subform based on option selection
    By trevor40 in forum Forms
    Replies: 2
    Last Post: 03-06-2014, 07:07 PM
  3. Replies: 3
    Last Post: 12-02-2012, 09:38 AM
  4. run parameter query based on option box selection
    By rivereridanus in forum Queries
    Replies: 1
    Last Post: 07-01-2011, 01:07 PM
  5. Replies: 3
    Last Post: 12-06-2010, 06:35 PM

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