Results 1 to 7 of 7
  1. #1
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136

    Making control visible in subform


    Hi all,
    I have a control that is hidden in a continuous subform that I want to make visible when the Add Record button is clicked on the main form. What's the syntax for that? Nothing I try seems to work.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Show what you have tried.
    http://access.mvps.org/access/forms/frm0031.htm

    You set the Visible property of the control to True.
    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
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136
    Code:
    Me!Subform1.Form!ControlName.Visible = True 
    The problem is it doesn't recognize the subform name. How do I know what the subform control is?

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    You look at it in design view?
    Click the edge of the subform, that should highlight the control with parent/child links etc.
    If you used the wizard it would be the same name as the subform. I always renamed mine.
    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

  5. #5
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136
    Quote Originally Posted by Welshgasman View Post
    You look at it in design view?
    Click the edge of the subform, that should highlight the control with parent/child links etc.
    If you used the wizard it would be the same name as the subform. I always renamed mine.
    Ok I finally got it. Thanks!

  6. #6
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Just for reference you cannot reference a subform with the Me!, you need to put in the actual name of the main form so like frmMain!Subform1.form!ControlName.Visible = True

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by Bulzie View Post
    Just for reference you cannot reference a subform with the Me!, you need to put in the actual name of the main form so like frmMain!Subform1.form!ControlName.Visible = True
    You can with Me. though?
    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

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

Similar Threads

  1. Replies: 5
    Last Post: 08-14-2017, 02:19 AM
  2. Replies: 6
    Last Post: 05-07-2013, 02:43 AM
  3. Replies: 3
    Last Post: 03-29-2012, 12:40 PM
  4. Making subform field visible/invisible
    By Snufflz in forum Forms
    Replies: 3
    Last Post: 01-17-2011, 05:30 AM
  5. Replies: 2
    Last Post: 01-06-2011, 04:38 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