Return a read-only form to edit

jtoutou

Registered User.
Local time
Today, 22:55
Joined
Dec 1, 2007
Messages
19
good afternoon to everyone....
Here is my problem...
in my application there are users and amin
there is a form which contains 3 subforms...
there is also a button called edit..
where the administrator enters a code ...

at the begining ....the form opens as a read-only form....after the password
i turn the "allow adition , edits, deletion to yes but the subforms stil have no.....
(form.allowedition=yes e.t.c)
shall i turn also the subforms one by one to yes
 
Last edited:
What you can do is set the subform to a locked state on the Form's OnOpen Event.
Subform1.Locked = True
or...
Subform1.Enabled = False

After the verify password event you can unlock the subform by changing the status. (True/False).

Otherwise you will have to reopen the form to allow edits/additions since the form is opened as read only.

Hope this helps.

Toby
 
i try also with a command button..
depending on the password the the form opens as readonly (for users) or edit data mode (for admin) but i still have the same problem..the subforms still in read only data
thanx for your reply..
 
so sorry for all....it was my fault....
when i made changes to subforms in design view i did open the form when it was commanded in read only data mode....so the allowaddition,edits,deletion were still no....
i change to yes so everythimg is seems to be perfect......thanx T.smith
 
Otherwise you will have to reopen the form to allow edits/additions since the form is opened as read only.
This isn't quite accurate. You can change a form to allow edits or additions, or deny them, while the form is opened (via code) and you do NOT need to close and reopen for it to take effect.
 
THE FORM IS OPEN ONCE....
OR AS ADMIN .... DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, acFormEdit
OR AS USER .....DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, acFormReadOnly
IS THIS A RIGHT WAY OR NOT?....
IF YOU HAVE ANY OTEHR SUGGESTION I WILL APRECIATE...THNAK YOU
 
My mistake. You can do it by using the form property and not having to reopen the form. You will have to do it for each subform.

Subform.Form.AllowAdditions = True

Thanks for correcting me Bob. :)
 
My mistake. You can do it by using the form property and not having to reopen the form. You will have to do it for each subform.

Subform.Form.AllowAdditions = True

Thanks for correcting me Bob. :)

No problem. Believe me, I have my moments too - still... :)
 
Hi Jtoutou,

I'm trying to do the exact same thing --- have an administrator password allow editing on a form with subforms.

What setup did you use in your code/macro that would allow this? Would be much appreciated! Thanks
 

Users who are viewing this thread

Back
Top Bottom