A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Lock a form



 
 
Thread Tools Display Modes
  #1  
Old February 12th, 2010, 08:11 PM posted to microsoft.public.access.forms
Daniel P.[_2_]
external usenet poster
 
Posts: 8
Default Lock a form

I'm currently using Access 2007 and I would like to lock down controls in a
form with a button, but AFTER it has been edited by the user. In this forum,
I read about some pretty clever coding for locking bound controls, but it
doesn't quite fit my needs. The new forms usually open in a locked state
(which bothers me a bit since data will be added regularly), while some blank
textboxes, that the user has to fill by himself, are not locked at all.

I would like the form to open unlocked by default (or at least apply no
locks on a newly created form), so that the user can manually lock all the
controls, bound or unbound, with a click on a command button, after he's
finished. Maybe it's not kosher with Access, but I'd prefer to avoid heavy
programming in VBA, for I am not really an expert on that matter.

Thanks in advance !
  #2  
Old February 12th, 2010, 09:51 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Lock a form

Forms have properties to manage this.
On the form's property dialog, on the data tab.
Look at the property for allow edits.
If allow edits is set to false, user can't edit any controls.

You're button can simply set allow edits to false.
Me.AllowEdits = False

You may need to do any validation checks (if you have any) before user locks
the form.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"Daniel P." wrote in message
...
I'm currently using Access 2007 and I would like to lock down controls in
a
form with a button, but AFTER it has been edited by the user. In this
forum,
I read about some pretty clever coding for locking bound controls, but it
doesn't quite fit my needs. The new forms usually open in a locked state
(which bothers me a bit since data will be added regularly), while some
blank
textboxes, that the user has to fill by himself, are not locked at all.

I would like the form to open unlocked by default (or at least apply no
locks on a newly created form), so that the user can manually lock all the
controls, bound or unbound, with a click on a command button, after he's
finished. Maybe it's not kosher with Access, but I'd prefer to avoid heavy
programming in VBA, for I am not really an expert on that matter.

Thanks in advance !



  #3  
Old February 13th, 2010, 12:38 AM posted to microsoft.public.access.forms
Daniel P.[_2_]
external usenet poster
 
Posts: 8
Default Lock a form

Thanks a lot, first of all for the advice !

For some reason, I can't get Allow Edits to function the way you suggest...
If I put this option on "No" in the Form Properties, I can edit anything
within the form without any trouble. Am I doing something wrong ?

"Jeanette Cunningham" wrote:

Forms have properties to manage this.
On the form's property dialog, on the data tab.
Look at the property for allow edits.
If allow edits is set to false, user can't edit any controls.

You're button can simply set allow edits to false.
Me.AllowEdits = False

You may need to do any validation checks (if you have any) before user locks
the form.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"Daniel P." wrote in message
...
I'm currently using Access 2007 and I would like to lock down controls in
a
form with a button, but AFTER it has been edited by the user. In this
forum,
I read about some pretty clever coding for locking bound controls, but it
doesn't quite fit my needs. The new forms usually open in a locked state
(which bothers me a bit since data will be added regularly), while some
blank
textboxes, that the user has to fill by himself, are not locked at all.

I would like the form to open unlocked by default (or at least apply no
locks on a newly created form), so that the user can manually lock all the
controls, bound or unbound, with a click on a command button, after he's
finished. Maybe it's not kosher with Access, but I'd prefer to avoid heavy
programming in VBA, for I am not really an expert on that matter.

Thanks in advance !



.

  #4  
Old February 13th, 2010, 07:51 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Lock a form

Are you sure that you set allow edits to No on the same form that you are
test ing?
Perhaps you have a subform on that form and the subform needs to have allow
edits set to No?
Perhaps you have some code behind that form that sets allow edits to Yes?

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Daniel P." wrote in message
...
Thanks a lot, first of all for the advice !

For some reason, I can't get Allow Edits to function the way you
suggest...
If I put this option on "No" in the Form Properties, I can edit anything
within the form without any trouble. Am I doing something wrong ?

"Jeanette Cunningham" wrote:

Forms have properties to manage this.
On the form's property dialog, on the data tab.
Look at the property for allow edits.
If allow edits is set to false, user can't edit any controls.

You're button can simply set allow edits to false.
Me.AllowEdits = False

You may need to do any validation checks (if you have any) before user
locks
the form.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"Daniel P." wrote in message
...
I'm currently using Access 2007 and I would like to lock down controls
in
a
form with a button, but AFTER it has been edited by the user. In this
forum,
I read about some pretty clever coding for locking bound controls, but
it
doesn't quite fit my needs. The new forms usually open in a locked
state
(which bothers me a bit since data will be added regularly), while some
blank
textboxes, that the user has to fill by himself, are not locked at all.

I would like the form to open unlocked by default (or at least apply no
locks on a newly created form), so that the user can manually lock all
the
controls, bound or unbound, with a click on a command button, after
he's
finished. Maybe it's not kosher with Access, but I'd prefer to avoid
heavy
programming in VBA, for I am not really an expert on that matter.

Thanks in advance !



.





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.