Results 1 to 4 of 4
  1. #1
    newbieX is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    111

    Hiding navigation buttons on child subform code only works once


    I have an Access 2010 form that has a child subform based on a query. I am trying to hide the navigation buttons for the subform.

    Code:
    Private Sub Form_Open(Cancel As Integer)
    
        'Me.Form.NavigationButtons = False
        Me.Child001.Form.NavigationButtons = False
    
    End Sub
    Code:
    Private Sub cmdCloseForm_Click()
        'Me.Form.NavigationButtons = True
        Me.Child001.Form.NavigationButtons = True
    End Sub

    The parent form's Navigations Button property is set to No, as is its Record Selectors. The problem I am having is that the navigation buttons is hidden the first time I open the form after adding/altering the code but then displays each subsequent opening of the form. Changing the properties back when closing does not seem to make a difference.

    Ideas as to why this is happening and how I can fix it?

    Many thanks in advance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Open event has code to hide the buttons but if the property is set to No in design, why do you need code?
    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
    newbieX is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    111
    For some reason, not all the parent form's properties transfer to the child form when the child form is a query datasheet. Like I said, works once and then never again. Even if I exit and reopen database. Weird.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I never use tables and queries as subform SourceObject. Tables and queries don't have NavigationButtons property. I am surprised your code works at all if the SourceObject is a table or query.
    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. Problem with hiding Ribbon & Navigation Code
    By Greyhound Friend in forum Programming
    Replies: 9
    Last Post: 03-31-2014, 09:26 AM
  2. Replies: 11
    Last Post: 12-11-2013, 10:35 AM
  3. Showing/Hiding Navigation Buttons in VBA or Macro
    By chris.williams in forum Forms
    Replies: 3
    Last Post: 11-15-2011, 10:38 AM
  4. Navigation Buttons Stop My Code
    By millerdav99 in forum Programming
    Replies: 6
    Last Post: 03-18-2011, 11:13 AM
  5. Replies: 1
    Last Post: 01-04-2011, 05:04 AM

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