Set Allow Edits property to "no" causes problem

B

bejhan

I have a form (let's call it recordform) which has its Record Source
selecting fields form a table. Text boxes in this form have control sources
as fields from the table. The allow edits property of recordform is set to
"no".

I have recordform as a subform in another form (let's call it mainform).
When I select a record in recordform via mainform and press "delete" on my
keyboard the deletion confirmation comes up. If I press "no", the
confirmation comes up again. [Note: If I press "yes", no second confirmation
comes up and it deletes the record.] If I press "no" again it goes away.

[Note: If I am just in recordform and delete a record this problem doesn't
occur.]

I did a bunch of tests and found that it is indeed the allow edits property
that is causing this to happen.

Why is this happening and how can I fix it?
 
L

Linq Adams via AccessMonster.com

I'm not sure exactly what's going on, but if your recordform is always going
to be used as a subform, it doesn't really matter whether AllwowEdits is set
to Yes or No on the form itself, as a subform always inherits the AllowEdits,
as well as the AllowAdditions and AllowDeletions settings of the main form,
regardless of how the settings appear in the form used as a subform. If
testing shows the AllowEdits set to No in recordform is casuing the problem,
set it to Yes.
 
N

NKTower

This might be worth a try to get around that behavior...
If your intent for AllowEdits=No is to prevent changes, try this instead:
a) Change all of data bound controls in the recordform subform to be
LOCKED=TRUE
and then
b) set your AllowEdits = TRUE
 
B

bejhan

I want the user to be able to add and delete records. Just not edit the
contents of existing records. So locking the textboxes is not an option.

NKTower said:
This might be worth a try to get around that behavior...
If your intent for AllowEdits=No is to prevent changes, try this instead:
a) Change all of data bound controls in the recordform subform to be
LOCKED=TRUE
and then
b) set your AllowEdits = TRUE

bejhan said:
I have a form (let's call it recordform) which has its Record Source
selecting fields form a table. Text boxes in this form have control sources
as fields from the table. The allow edits property of recordform is set to
"no".

I have recordform as a subform in another form (let's call it mainform).
When I select a record in recordform via mainform and press "delete" on my
keyboard the deletion confirmation comes up. If I press "no", the
confirmation comes up again. [Note: If I press "yes", no second confirmation
comes up and it deletes the record.] If I press "no" again it goes away.

[Note: If I am just in recordform and delete a record this problem doesn't
occur.]

I did a bunch of tests and found that it is indeed the allow edits property
that is causing this to happen.

Why is this happening and how can I fix it?
 
B

bejhan

Okay I just tested that. I set allow edits to no in the mainform and yes in
the recordform but then I just couldn't do anything, no deletions or
additions either. Which is not what I am going for. I want users to be able
to delete and add records in the recordform just not edit existing ones.
 

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