Results 1 to 6 of 6
  1. #1
    selvakumar.arc is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    49

    Post How to display multiple Subform in main form

    Hi All,

    How I will show multiple subform in main page based on some condition. I have a scenrio that based on datasheet column criteria I need to display different subform in my screen.

    For example I have a column named Decision Criteria have following values "", "A", "B", "C". If coumn value is "A" then I need to show Subform A, similarly other subform also and if couldmn has empty value then I should not display subform.

    Could any one have idea how to implement this? or if you have any different approach - to show different subform in same form then please suggest me.

    Regards,
    Selvakumar R

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Why do you have different subforms for different criteria? Have one form and filter the records.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by June7 View Post
    Why do you have different subforms for different criteria? Have one form and filter the records.
    That would depend, of course, on whether the various Subforms were identical field-wise or held widely deferring fields, wouldn't it?

    But the real problem, here, I suspect, is we're talking about the Main Form being a Datasheet View Form. While you can place a Subform on a Datasheet View Form, it actually appears as a SubDataSheet (the little (+) sign attached to the left-most Textbox on the Record) that can be clicked to drop down to show the related information, rather than a Subform, per se.

    And because it is a Datasheet View Form, whatever it shows for the Current Form is going to be displayed for all Records, on the Main Form. And possibly the linking Field, when [Decision Criteria] is A, to the A Subform, may not even be present in the B Subform, when [Decision Criteria] is A.

    I think you're really going to have to give us a much better plain-language explanation of what you're doing, here, in order for us to help.

    Linq ;0)>

  4. #4
    selvakumar.arc is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    49
    Hi,
    Thanks Linq & June7.
    I have a "decision link" column in main form and its detailed values are stored in different sub table (please find the details below). For example if user entered Table A in Decision Link column then I need to show data from Table A from the below list (when user click + sign), similarly for other 2 table values. Here column in each sub-form is different so I created 3 subform and assigned respective table names as datasource.
    After that I am trying to hide subforms based on Decision Link column value but I am unable to do that.

    Table A Table B Table C
    Decision Link Decision Link Decision Link
    Implementation Date Category Code ZipCode
    Expiration Date Buffer
    Effective Date

    Regards,
    Selvakumar R

  5. #5
    RonL is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Location
    NJ
    Posts
    114
    Quote Originally Posted by selvakumar.arc View Post
    Here column in each sub-form is different so I created 3 subform and assigned respective table names as datasource. After that I am trying to hide subforms based on Decision Link column value but I am unable to do that.

    Table A Table B Table C
    Decision Link Decision Link Decision Link
    Implementation Date Category Code ZipCode
    Expiration Date Buffer
    Effective Date
    The particular subform that appears within a subform control is determined by that control's Source Object property.

    So in the AfterUpdate event for the DecisionLink control, you might try a Select Case block, testing for each of the table names and coding to set the subform control's Source Object property appropriately. Depending on the design of each subform, you may need to change the Link Master and Link Child properties as well.

    HTH -Ron

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Still not understanding data structure. If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 04-30-2013, 07:55 PM
  2. Replies: 16
    Last Post: 02-13-2012, 03:32 PM
  3. Replies: 7
    Last Post: 11-07-2011, 06:31 AM
  4. Replies: 2
    Last Post: 06-17-2010, 04:15 PM
  5. Subform won't display in main form
    By Lynn in forum Forms
    Replies: 15
    Last Post: 03-22-2010, 10:17 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