Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2013
    Posts
    70

    Unanswered: Remove Record Selectors and Navigation Buttons

    Access 2000. Hi, I have a form that I use both as an add records and as an edit records form depending on how it is opened. When I open it as an add record form I want the record selectors and navigation buttons controls to not show up. If I open it as an edit records form I want to be able to use the record selectors and the navigation buttons. Is there a way in VB to do this? Thanks, Scott

  2. #2
    Join Date
    Nov 2011
    Posts
    413
    Sure, Modify this to your needs.

    DoCmd.OpenForm "YourFormName" 'No Additions
    Me.YourControlName.Visible = False
    If Me.Dirty Then Me.Dirty = False 'Save any New Records
    Me.AllowAdditions = True
    Me.AllowEdits = False

    DoCmd.OpenForm "YourFormName" 'No Edits
    Me.YourControlName.Visible = False
    If Me.Dirty Then Me.Dirty = False 'Save any Edited Records
    Me.AllowAdditions = False
    Me.AllowEdits = True

    HTH
    Last edited by Burrina; 10-06-13 at 01:19. Reason: Further Explanation

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by brastedhouse View Post

    ...When I open it as an add record form I want the record selectors and navigation buttons controls to not show up. If I open it as an edit records form I want to be able to use the record selectors and the navigation buttons...
    How do you tell what mode you're opening the Form in?

    Are you speaking about the native Navigation and Record Selector Controls, or custom Command Buttons? IF you're referring to the native Controls the code would be

    Code:
    Me.NavigationButtons = False
    Me.RecordSelectors = False


    or

    Code:
    Me.NavigationButtons = True
    Me.RecordSelectors = True


    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Mar 2013
    Posts
    70

    selectors and buttons

    hi, you are correct, i am trying to turn off the native controls. here is a the code that i am using. i am not getting any errors but it does not turn off the controls. the form looks and works fine. it comes up as add only and adds records.

    am i putting the the code in correctly? best, scott

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmFBOrders"
    DoCmd.OpenForm stDocName, , stLinkCriteria, acFormAdd
    Me.NavigationButtons = False
    Me.RecordSelectors = False

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    The code

    Code:
    Me.NavigationButtons = False
    Me.RecordSelectors = False

    Has to be in the code behind the Form being opened.

    Change

    Code:
    DoCmd.OpenForm stDocName, , stLinkCriteria, acFormAdd

    to

    Code:
    DoCmd.OpenForm stDocName, , stLinkCriteria, acFormAdd,,,"Add"

    Then, in the code module for frmFBOrders, use this

    Code:
    Private Sub Form_Load()
     If Me.OpenArgs = "Add" Then
      Me.NavigationButtons = False
      Me.RecordSelectors = False
     Else
      Me.NavigationButtons = True
      Me.RecordSelectors = True
     End If
    End Sub

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    Mar 2013
    Posts
    70

    Remove Record Selectors and Navigation Buttons

    Hi Missinglinq, many thanks. It worked like a charm. And I appreciate your patience and the way you described it. I understand what you did. It was a big help both to get this to work and to learn how to do this in the future. Best, Scott

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help, Scott!

    Welcome to the forum!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •