Adding records to subforms

C

Cathleen

I have a form with two nested subforms, each with a source from a different
table. I would like users to be able to add records but not make edits or
deletions. However, when I set the Allow Edits property of the main form to
No, I can no longer add new records to the subforms. (I can add records to
subfroms when the main form Allow Edits property is set to Yes). How can make
the subforms accept new records without allowing edits to the form?

Thanks so much for any advice I can get!
 
J

John W. Vinson

I have a form with two nested subforms, each with a source from a different
table. I would like users to be able to add records but not make edits or
deletions. However, when I set the Allow Edits property of the main form to
No, I can no longer add new records to the subforms. (I can add records to
subfroms when the main form Allow Edits property is set to Yes). How can make
the subforms accept new records without allowing edits to the form?

Thanks so much for any advice I can get!

You will indeed need to have the mainform's allow edits true to permit any
editing (including additions) on the subforms. What you can do is use the
mainform's Beforeupdate event to cancel any changes, with any warning message
you want (or none at all). Just set the BeforeUpdate event's Cancel argument
to True.
 
J

John W. Vinson

I have a form with two nested subforms, each with a source from a different
table. I would like users to be able to add records but not make edits or
deletions. However, when I set the Allow Edits property of the main form to
No, I can no longer add new records to the subforms. (I can add records to
subfroms when the main form Allow Edits property is set to Yes). How can make
the subforms accept new records without allowing edits to the form?

Thanks so much for any advice I can get!

You will indeed need to have the mainform's allow edits true to permit any
editing (including additions) on the subforms. What you can do is use the
mainform's Beforeupdate event to cancel any changes, with any warning message
you want (or none at all). Just set the BeforeUpdate event's Cancel argument
to True.
 

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