473,785 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB Code to change the Allow Additions Property


I want users to be able to set the Allow Additions property to 'True'
via a command button when required. (The command also adds data to the
subform) If they skip the command, they skip the data transfer. Hence
I want to set the Allow Additions property via a command button.

I set up the command button with the following code, but I keep
getting an error: Method or Data Member not found (Debug highlights
the allow additions section.

The command button is located on the main form.

Here are the variations of code I have tried;

Private Sub Create_Job_Clic k()
Me.Field_Form_S ub.Visible = True
Me.Field_Form_S ub.SetFocus
Field_Sub_Form. AllowAdditions = True
DoCmd.GoToRecor d , , acNewRec

Private Sub Create_Job_Clic k()
Me.Field_Form_S ub.Visible = True
Me.Field_Form_S ub.SetFocus
Me.Field_Sub_Fo rm.AllowAdditio ns = True
DoCmd.GoToRecor d , , acNewRec

Private Sub Create_Job_Clic k()
Me.Field_Form_S ub.Visible = True
Me.Field_Form_S ub.SetFocus
Me.AllowAdditio ns = True
DoCmd.GoToRecor d , , acNewRec

Am I putting the Allow additions in the wrong place? Any help would be
greatly appreciated.

Mar 30 '07 #1
3 10000
THis is for Access 2000 SP3.
On Mar 30, 4:23 pm, paq...@gmail.co m wrote:
I want users to be able to set the Allow Additions property to 'True'
via a command button when required. (The command also adds data to the
subform) If they skip the command, they skip the data transfer. Hence
I want to set the Allow Additions property via a command button.

I set up the command button with the following code, but I keep
getting an error: Method or Data Member not found (Debug highlights
the allow additions section.

The command button is located on the main form.

Here are the variations of code I have tried;

Private Sub Create_Job_Clic k()
Me.Field_Form_S ub.Visible = True
Me.Field_Form_S ub.SetFocus
Field_Sub_Form. AllowAdditions = True
DoCmd.GoToRecor d , , acNewRec

Private Sub Create_Job_Clic k()
Me.Field_Form_S ub.Visible = True
Me.Field_Form_S ub.SetFocus
Me.Field_Sub_Fo rm.AllowAdditio ns = True
DoCmd.GoToRecor d , , acNewRec

Private Sub Create_Job_Clic k()
Me.Field_Form_S ub.Visible = True
Me.Field_Form_S ub.SetFocus
Me.AllowAdditio ns = True
DoCmd.GoToRecor d , , acNewRec

Am I putting the Allow additions in the wrong place? Any help would be
greatly appreciated.

Mar 30 '07 #2

The sub form control is called Field_Form_Sub?
If so it does not have an AllowAdditions property. The underlying form
does.
Try Me.Field_Form_S ub.Form.AllowAd ditions = True

Mar 31 '07 #3
Perfect!
I wasnt stipulating the Subform. A Duh.
Thanks

Apr 4 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1765
by: scooterm | last post by:
### Background In it is possible to specify any special and arbitrary directory (or set of directories) to use as a source for custom, user-designed modules. For example, one can do: ### begin script ### (located in ../faa/faa_script.xyz) ### init script
1
30767
by: denis_bernicky | last post by:
I have been given a database on a CD to do some work on. The only problem is that when I open a form it tells me that the file path //server/database/mydb.mdb is not valid. Of course it isn't valid the whole thing is on my comp at the moment and not even on a network. How can I change this path so that I can work on the database locally and change it back when I put the changes back? Thank you for any help.
13
2918
by: Peter | last post by:
Can anyone tell me how to change the data type of a field in a table created with a make table query? The field is a binary and must be changed to text. alternately does anyone know how to specify the field type when running a make table query? Thanks, Sven
6
3183
by: Cro | last post by:
Dear Access Developers, The 'Allow Additions' property of my form is causing unexpected results. I am developing a form that has its 'Default View' property set to 'Continuous Forms' and am displaying records that match an SQL statement entered in the 'Record Source' property of the form. The form behaves correctly and displays the records as expected. The
6
3948
by: Sally | last post by:
I need to be able to click in a subform and run code but at the same time I need to be able to scroll the records without running the code. I tried coding the Enter event of the subform control but when I try to scroll the records the code runs. The subform is continuous; all the controls are on one line and the detail section is not exsposed above or below the controls. I tried coding the detail Click event but nothing happened. I tried...
65
12615
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second method was a piece of C code which turned out to be incorrect and incomplete but by modifieing it would still be usuable. The first method was this piece of text:
11
4580
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing opinion of how I want to handle the 'user experience' in the application I'm creating. While I know I could allow the user to enter in number and alpha text - in a text box - and then tell them when the execuate a command "This is not numeric data", I...
1
1434
by: GraemeC | last post by:
I have a form where I have "Allow edits" set as no and "Allow additions" as yes. The form displays data in a continuous form. The user can add new records but can't edit returned records.I do however want to be able change some fields if they click an action button. How do I allow fields to be updated using events and VBA code? Thanks
2
6125
by: blakerrr | last post by:
Hi All, I have a subform, which needs to allow for additions. When I set the "Allow Additions" property to Yes, the form still doesn't allow me to add anything. Am I missing something here??? Thanks.
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.