AllowEdits: One more question

P

polman

Ok. For one more time I need your help.
I have a form and a subform in it. On after update event on both (form
and subform) I added the simplest thing I could think: Me.AllowEdits =
False. In both I added a button with on click event Me.AllowEdits =
True. That is working the way I want for the records already in the
database. (That is, when the user click on the button can edit the
field on form or subform and when is done (afterupdate) the form's
AllowEdit is set again to false). Well! I almost did it! But NO!
When I try to add a new record on main form the subform is
disappeared... After some search I found out that besides the
AllowEdits property of the subform it was set to False the
AllowDeletions and AllowAdditions properties (When I change them to
True the form is appearing again).
Could please someone explain to me what is happening here? Do I have to
add additional code or something else I did not understood.
P.S. I also tried the code of Allen Browne
http://allenbrowne.com/ser-56.html with the same results (but this
probably because I did not implement it right).
 
P

polman

One important addition to my previous question: This (disappeared form)
is not happening always. It happens when I change from design view to
normal view. When I am on normal view and I change the properties
(Allow...) to True it works fine afterwards.
I read something about inconsistency in Access on this subject in an
answer to similar question from Allen...
Thank you.
 
A

Allen Browne

There's an explanation of why the subform disappears here:
Why does my form go completely blank?
at:
http://allenbrowne.com/casu-20.html

If the form is opened with Allow... set to No, then the subform is not
editable either. Setting the Allow... properties to True for the subform
control and subform as you suggest sounds like a perfectly reasonable
workaround.

The article you referred to at:
http://allenbrowne.com/ser-56.html
works if you leave the Allow... properties alone, and set the Locked
properties of the controls instead.
 
P

polman

Thank you Allen. You are always very helpful.
The strange think about is that I do not set in any place in my code
the AllowAdditions to No it happens by it self when I change from the
design view to normal view and the AllowEdits property was set to
False. All the other condition that the article is referring to is
true.
Thank you for your reply. My work around is to set it (AllowAdditions)
back to True upon open event...
I hope this is the best way in my situation.
Manolis Polenis

Ï/Ç Allen Browne Ýãñáøå:
 
A

Allen Browne

That sounds fine.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Thank you Allen. You are always very helpful.
The strange think about is that I do not set in any place in my code
the AllowAdditions to No it happens by it self when I change from the
design view to normal view and the AllowEdits property was set to
False. All the other condition that the article is referring to is
true.
Thank you for your reply. My work around is to set it (AllowAdditions)
back to True upon open event...
I hope this is the best way in my situation.
Manolis Polenis

Ï/Ç Allen Browne Ýãñáøå:
 

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