Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Change SubForm to "Allowadditions"

Posted on 2005-03-16
1
Medium Priority
?
530 Views
Last Modified: 2011-09-20
I have a subform linked to the main form by a field "UniqueID". On the subform the User can click on the navigation buttons and create a new record without even knowing he did. To prevent this automatic new record creation from occurring I set the following:

                   I set the subform to AllowAdditions "NO" on the property sheet.
                   I then added a button using the wizard to Add a new record and as expected
                   it does not allow me to add a new record because AllowAdditions is set to "No".

In vba code how do I change the property of the subform from AllowAdditions "No" to AllowAdditions "yes" before I can add a nerw record.

If there is a better way to prevent the user from clicking on the navigation buttons and creating a new record wothout knowing he did, please advise me how to do this.   I will still need a "Add New Record Button" for the user to create a new record when he really wants to.

Lou
0
Comment
Question by:Lou Dufresne
1 Comment
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 2000 total points
ID: 13559240
Try:
Me!MySubformControl.Form.AllowAdditions=True

MySubformControl is the name of the subform container object, not the subform itself (design the main form, click once on the subform and check the Name property in the properties window).

As to a better way, I tend to use my own navigation buttons instead of the built in form buttons and combined with an "Add new" button as you describe (although I use SQL to add the record and then navigate to it).
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question