467,169 Members | 972 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,169 developers. It's quick & easy.

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_Click()
Me.Field_Form_Sub.Visible = True
Me.Field_Form_Sub.SetFocus
Field_Sub_Form.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec

Private Sub Create_Job_Click()
Me.Field_Form_Sub.Visible = True
Me.Field_Form_Sub.SetFocus
Me.Field_Sub_Form.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec

Private Sub Create_Job_Click()
Me.Field_Form_Sub.Visible = True
Me.Field_Form_Sub.SetFocus
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec

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

Mar 30 '07 #1
  • viewed: 9042
Share:
3 Replies
THis is for Access 2000 SP3.
On Mar 30, 4:23 pm, paq...@gmail.com 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_Click()
Me.Field_Form_Sub.Visible = True
Me.Field_Form_Sub.SetFocus
Field_Sub_Form.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec

Private Sub Create_Job_Click()
Me.Field_Form_Sub.Visible = True
Me.Field_Form_Sub.SetFocus
Me.Field_Sub_Form.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec

Private Sub Create_Job_Click()
Me.Field_Form_Sub.Visible = True
Me.Field_Form_Sub.SetFocus
Me.AllowAdditions = True
DoCmd.GoToRecord , , 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_Sub.Form.AllowAdditions = True

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

Apr 4 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by scooterm@hotmail.com | last post: by
1 post views Thread by denis_bernicky@yahoo.com | last post: by
6 posts views Thread by Sally | last post: by
11 posts views Thread by Keith | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.