change Allow Additions to No on Subform

G

Guest

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
 
M

Marshall Barton

Captain said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top