change Allow Additions to No on Subform 
Author Message
 change Allow Additions to No on Subform

Hello,
I have MainForm; SubForm1; and SubForm2.  

When the checkbox = Yes on SubForm1, I want the AllowAdditions; AllowEdits;
and AllowDeletions to = No on SubForm2, Where the PrimaryKey in SubForm1 =
the ForeignKey in SubForm2.

I am not very good with VBA but will try whatever solution offered.  I do
fairly well with macros.

I appreciate the help.

Thank you,
Captain OhNo



Wed, 05 Dec 2007 04:27:10 GMT  
 change Allow Additions to No on Subform

Quote:

>I have MainForm; SubForm1; and SubForm2.  

>When the checkbox = Yes on SubForm1, I want the AllowAdditions; AllowEdits;
>and AllowDeletions to = No on SubForm2, Where the PrimaryKey in SubForm1 =
>the ForeignKey in SubForm2.

>I am not very good with VBA but will try whatever solution offered.  I do
>fairly well with macros.

The syntax to set properties on subform2 from code in
subform1 is:

        Parent.subform2.Form.AllowAdditions = False

If you want that to happen as soon as the check box is
checked, then put the code in the check box's AfterUpdate
event.

If the check box is bound to a field in subform1's record
source table/query, then you will probably also want the
same code in subfom1's Current event.

--
Marsh
MVP [MS Access]



Wed, 05 Dec 2007 11:48:09 GMT  
 change Allow Additions to No on Subform
Marsh
Thank you for the help.  I will try it.
Carla
Quote:

> Hello,
> I have MainForm; SubForm1; and SubForm2.  

> When the checkbox = Yes on SubForm1, I want the AllowAdditions; AllowEdits;
> and AllowDeletions to = No on SubForm2, Where the PrimaryKey in SubForm1 =
> the ForeignKey in SubForm2.

> I am not very good with VBA but will try whatever solution offered.  I do
> fairly well with macros.

> I appreciate the help.

> Thank you,
> Captain OhNo



Sat, 08 Dec 2007 03:13:06 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. subform resets Allow Edits, Deletions and Additions to No

2. Subform allow addition

3. SubForm Allow Additions

4. not Allowing Additions on subforms

5. Subform Not allowing addition of record

6. Problem: Subform won't Allow Additions

7. Adding records to Subform after changing Allow Edit Property

8. Is it possible to allow/not allow editing to certain fields in a subform

9. My forms will not allow additions and my tables get a + column

10. how do you allow additions in a sub form


 
Powered by phpBB® Forum Software © phpBB Group