Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 208521 - Last Review: June 24, 2004 - Revision: 2.0
ACC2000: Form with AllowAdditions Set to No Allows New Records
This article was previously published under Q208521
Novice: Requires knowledge of the user interface on single-user computers.
When you open a form that has the
AllowAdditions property set to No, the form allows you to add records.
The form is being opened programmatically by the OpenForm action with
the
Data Mode argument in the macro set to Edit. If you're using Visual Basic, the
Data Mode argument is set to acFormEdit, A_EDIT or acEdit.
Omit the
Data Mode argument setting so that Microsoft Access uses the property settings defined by the form.
When the
Data Mode argument of the OpenForm action is set, Microsoft
Access overrides a number of form property settings. If the
Data Mode argument of the OpenForm action is set to Edit, Microsoft Access
opens the form using the following property settings:
AllowEdits: Yes
AllowDeletions: Yes
AllowAdditions: Yes
DataEntry: No
Microsoft Access uses the default form property settings if you omit
the
Data Mode argument in the OpenForm macro action.
This behavior is likely to occur when you have a macro that opens a
form, because the
Data Mode argument is set to Edit by default.
Steps to Reproduce Behavior
- Open the sample database Northwind.mdb.
- Open the Customers form in Design view and set the AllowAdditions property to No. Save, and then close the form.
- Create a new macro with the following action:
Macro Action
-----------------------
OpenForm
Form Name: Customers
View: Form
Filter Name:
Where Condition:
Data Mode: Edit
Window Mode: Normal
NOTE: The Data Mode argument is Edit by default.
- Save the macro with a unique name, and then run the macro by clicking
Run on the Run menu. Note that the Customers form opens but allows you to add new records.
- Close the Customers form and delete Edit from the Data Mode argument of the OpenForm action. Save and rerun the macro by clicking Run on the Run menu. Note that the Customer form opens but does not allow you to add new records.
For more information about the OpenForm action, click
Microsoft Access Help on the
Help menu, type
openform action in the Office Assistant or the Answer Wizard, and then click
Search to view the topic.
APPLIES TO
- Microsoft Access 2000 Standard Edition
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate