subform resets Allow Edits, Deletions and Additions to No

P

Paul Ponzelli

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
 
P

Paul Ponzelli

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
 
D

Dirk Goldgar

Paul Ponzelli said:
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.
 
P

Paul Ponzelli

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
 

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