Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2007

    Unanswered: disable form new record button

    I created a set of buttons in my form. e.g. undo, save, new record and etc. I was able to do that.

    Now, I want to disable the add button on the bottom of the form. I checked Allow additions = No under the Form property. It did disable the add new record button on the bottom of the form but it also disable my new record button to open up a new record.

    I think I need some code under the my new record button to reset the Form Allow Additions to Yes.

    This is my VBA code for my new record button (it is the default Access VBA code)

    Private Sub CreateNewRecord_Click()
    On Error GoTo Err_CreateNewRecord_Click

    DoCmd.GoToRecord , , acNewRec

    Exit Sub

    MsgBox Err.Description
    Resume Exit_CreateNewRecord_Click

    End Sub

    When I click the new record button, Access complaint that "Can't go to the specified record"
    Any help is greatly appreciate it.


  2. #2
    Join Date
    Sep 2007
    Ohh!! I find the solution. All I need to do is to add the following line in the code.

    It is working now. Thanks

    Me.AllowAdditions = True

  3. #3
    Join Date
    Dec 2004
    Madison, WI
    Yes it will work but also keep in mind that once you click the "Add Record" button and set me.allowadditions = true, it's forever set to true while the form is open. This may or may not be what you want. What I do is...

    me.allowadditions = true
    me!MyDateEnteredField=Date() <- you have to update or set some data in some field.
    me.allowadditions = false
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Feb 2007
    I figured you were asking how about the Navigation Buttons property of the form.

  5. #5
    Join Date
    Sep 2007
    thank you both.

Posting Permissions

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