subform resets Allow Edits, Deletions and Additions to No 
Author Message
 subform resets Allow Edits, Deletions and Additions to No

I have a subform in which I'd like to be able to both add and edit records.
However, it keeps resetting its Allow Edits, Allow Deletions and Allow
Additions properties to No, even after I change all of these properties to
Yes (and save the changes).

A related problem is that if there are no existing records in the subform,
the subform is blank, so there is no way to add a new record to the subform.

I've checked other properties of the main form, subform control and
underlying query to see if any properties of these objects might be forcing
those subform properties to reset to No, but I can't find anything that
would conflict with editing or adding records to the subform.  For example,
all three "Allow" properties are set to Yes in the main form.  DataEntry is
set to No in both forms.  In both the main forms as well as the underlying
query, Recordset Type is Dynaset and Record Locks is set to No.  The Enable
property of the subform control is set to Yes, and Locked is set to No.

So I actually have two questions about this:

1. What keeps resetting the subform's "Allow" properties to No, and how can
I overcome this so I can edit records in the subform, and
2. How can I display empty form control fields in the subform so I can enter
new records when the recordset is empty?

Thanks in advance,

Paul



Sat, 13 Oct 2007 03:30:42 GMT  
 subform resets Allow Edits, Deletions and Additions to No
I finally realized that some VBA code was opening the form as Read Only
under certain circumstances, so I believe this may have been responsible for
resetting the "Allow" properties, so that takes care of the first part of my
question.  However, I'm still puzzled over the second part:

If there are no existing records in the subform, the subform is blank, and
there is no way to add a new record to the subform.  How can I display empty
form control fields in the subform so I can enter new records when the
subform recordset is empty?

Thanks,

Paul



Sat, 13 Oct 2007 04:40:26 GMT  
 subform resets Allow Edits, Deletions and Additions to No

Quote:
> I finally realized that some VBA code was opening the form as Read
> Only under certain circumstances, so I believe this may have been
> responsible for resetting the "Allow" properties, so that takes care
> of the first part of my question.  However, I'm still puzzled over
> the second part:

> If there are no existing records in the subform, the subform is
> blank, and there is no way to add a new record to the subform.  How
> can I display empty form control fields in the subform so I can enter
> new records when the subform recordset is empty?

This happens on any form when there are no records to display and no
records can be added.  Reasons for the inability to add records may
include:

1. AllowAdditions is set to No.

2. The recordsource query is not updatable.  There are a number of
reasons this might be so;  see the help topic "when can I update data
from a query?" or "troubleshooting queries" for things to check.

3. The database is read-only.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)



Sat, 13 Oct 2007 04:52:53 GMT  
 subform resets Allow Edits, Deletions and Additions to No
My recordsource query is updatable, but the VBA code that opens the form
sometimes opens it in Read Only mode, depending on the password used.  So
that would seem to have been the cause of the problem I was having.

Thanks for the information, Dirk.  It helped me identify the cause of the
problem I was having.

Paul

Quote:
> This happens on any form when there are no records to display and no
> records can be added.  Reasons for the inability to add records may
> include:

> 1. AllowAdditions is set to No.

> 2. The recordsource query is not updatable.  There are a number of
> reasons this might be so;  see the help topic "when can I update data
> from a query?" or "troubleshooting queries" for things to check.

> 3. The database is read-only.

> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com

> (please reply to the newsgroup)



Sat, 13 Oct 2007 13:29:58 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Allow Edits, Additions, Deletions

2. Controlling Sub-form data entry,edits,additions and deletions

3. Forms property converting to no edits, no deletions, no additions

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

5. AllowEdits/Additions/Deletions for subforms

6. Form won't allow edits or additions

7. allow edits/additions

8. Allow Deletions / Edit Menu...Delete Record

9. change Allow Additions to No on Subform

10. allow edits & not to allow edits


 
Powered by phpBB® Forum Software © phpBB Group