Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: How to Prevent Users from Adding New Records


View products that this article applies to.

Summary

In Microsoft Access 2000 you can control the user's ability to add records to a table when using a data entry form. The AllowAdditions property can prevent users from adding new records while still allowing them to view and modify the existing ones.

↑ Back to the top


More information

You can set the AllowAdditions property under the Data tab of the form's property sheet. The default setting is Yes (True or -1), and this setting allows the user to add new records. If you set this property to No (False or 0), the user cannot add new records. The No setting disables the New Record indicator on the toolbar and the Data Entry command on the Records menu.

The following example demonstrates how the AllowAdditions property works.

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

  1. Start Microsoft Access and open the sample database Northwind.mdb.
  2. Open the Customers form in Design view.
  3. If the property sheet is not displayed, on the View menu, click Properties to display the form's property sheet.
  4. In the Form property sheet, click the Data tab, and then set the AllowAdditions property to No.
  5. Add a command button to the Customers form. Set the command button's OnClick property to [Event Procedure], and then click the Build button to the right of the OnClick property box.
  6. Type the following statement in the Form_Customers module:
    Forms!Customers.AllowAdditions = True
  7. Close the Form_Customers module and save the Customers form.
  8. Open the Customers form in Form view.

    Note that Record on the Insert menu and the new record selector are disabled. You cannot add any records. However, if you click the command button, note that the new record options are enabled.

↑ Back to the top


References

For more information about restricting users' ability to manipulate records through a form, click Microsoft Access Help on the Help menu, type allowadditions property in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

↑ Back to the top


Keywords: KB208586, kbusage, kbinfo, kbhowto

↑ Back to the top

Article Info
Article ID : 208586
Revision : 2
Created on : 6/28/2004
Published on : 6/28/2004
Exists online : False
Views : 277