Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38

    SubForms in access main form

    Hello to all
    I want some solution...
    Actually I have one form
    In that top having combo box having field 11,12,13,14,15,16
    In that below combo box I have six different subforms


    Like child11,child12....,chield16
    If I select 11 in combo box then child11 sub form will open
    How to solve this one
    Please guide me

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    In the AfterUpdate event of the combobox:

    Code:
        Dim x As Integer
        For x = 11 To 16
            Me("child" & x).Visible = False
        Next
        
        Me("child" & CInt(Me!ComboBox)).Visible = True

  3. #3
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38
    Thanks for replying
    Due to busy schedule I will try later
    If u don't mind could you provide same logic by using if condition

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    What condition are you looking for?

  5. #5
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38
    Means if (combo box= 11) then
    Docmd.open sub form like child 11
    Else
    If(combobox=12) then
    Docmd.open sub form like child12
    I need this type of code if possible

  6. #6
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38
    I don't know which code exactly to use for docmd.?

  7. #7
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Subforms are not opened, they are displayed as objects on a main form.

  8. #8
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38
    Yaaaa, but my problem is only particular inform will display that enable to edit other subform will ideal means not clickable

  9. #9
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Sorry, don't understand that sentence.

  10. #10
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38
    If we work on one subform(selecting on 11 in combo box) then particular subform child11 is editable remain all 5 subforms are not clickable and not editable

  11. #11
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure I get what you are trying to do - you still want the subforms to be displayed but no changes allowed? Change the code "Visible=True" to "Locked=False" and vice versa.

  12. #12
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38
    Thanks brooo
    Superb working above code
    But the problem is intial form loading all 6 subforms displaying if I select on combo field only particular inform will displaying this is good but intial 6 form will not display on intial loading after selection on combo then subform will display

  13. #13
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    In form design, set the properties on the subforms in the way that you want it to be when the form opens.

  14. #14
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38
    If u don't mind could you tell me the process
    In On load option I put docmd . Maximum for full screen
    Where I need to see prority..
    If u don't mine could you tell me the code
    And where I need insert that one

  15. #15
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You do not need code for this. Set the properties in form design.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. can't put 2 subforms on a main form
    By cjohnson in forum Forms
    Replies: 6
    Last Post: 04-28-2017, 01:19 PM
  2. Replies: 11
    Last Post: 05-13-2015, 11:10 PM
  3. Replies: 1
    Last Post: 12-30-2013, 05:56 PM
  4. Multiple subforms to one main form
    By mick3911 in forum Forms
    Replies: 8
    Last Post: 02-25-2013, 09:40 PM
  5. Replies: 0
    Last Post: 12-16-2008, 07:49 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