?
Solved

Change SubForm to "Allowadditions"

Posted on 2005-03-16
1
Medium Priority
?
518 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

771 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