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  

How to lock record edits on a subform using a checkbox



 
 
Thread Tools Display Modes
  #1  
Old March 17th, 2006, 09:13 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How to lock record edits on a subform using a checkbox

I want to be able to lock records for editing in a subform by using a
checkbox, i.e. when the checkbox is unchecked the current record on the
subform can still be edited, when the checkbox is checked the record can only
be viewed, not edited. I would also like to attach some kind of password
control to the checkbox to prevent users from unchecking the chkbox to amend
data.
  #2  
Old March 17th, 2006, 01:06 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How to lock record edits on a subform using a checkbox

Debra,
Add a new field to the table for your subform (ex. chkLocked -
True/False), and place it your subform.
On the AfterUpdate event of chkLocked use this code...
If chkLocked = True then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
End If
*Use this same code on the OnCurrent event of the subform record.

That should do it...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"Debra" wrote in message
...
I want to be able to lock records for editing in a subform by using a
checkbox, i.e. when the checkbox is unchecked the current record on the
subform can still be edited, when the checkbox is checked the record can
only
be viewed, not edited. I would also like to attach some kind of password
control to the checkbox to prevent users from unchecking the chkbox to
amend
data.



  #3  
Old March 17th, 2006, 03:15 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How to lock record edits on a subform using a checkbox

Al,

I use a similar checkbox for completed jobs to prevent users from
inadvertently changing data once the record should be "finalized" - however,
if someone checks that box by mistake, then I would have to go back in to
the table to reset it. I got around this by adding a new button which is the
only enabled control on the form, which is visible only if the checkbox =
true, and then having a confirmation dialog box ("Are you SURE you want to
change the status of this job?"

This works fine in my app, but Debra wanted to allow this via security - how
would one set that up? (Assuming, of course, that you already have Access
Security enabled)

TIA,

SusanV




"Al Camp" wrote in message
...
Debra,
Add a new field to the table for your subform (ex. chkLocked -
True/False), and place it your subform.
On the AfterUpdate event of chkLocked use this code...
If chkLocked = True then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
End If
*Use this same code on the OnCurrent event of the subform record.

That should do it...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"Debra" wrote in message
...
I want to be able to lock records for editing in a subform by using a
checkbox, i.e. when the checkbox is unchecked the current record on the
subform can still be edited, when the checkbox is checked the record can
only
be viewed, not edited. I would also like to attach some kind of password
control to the checkbox to prevent users from unchecking the chkbox to
amend
data.





  #4  
Old March 20th, 2006, 03:00 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How to lock record edits on a subform using a checkbox

Al and Susan, Thanks for all your help, I've copied the code and it works a
treat! cheers! debs

"SusanV" wrote:

Al,

I use a similar checkbox for completed jobs to prevent users from
inadvertently changing data once the record should be "finalized" - however,
if someone checks that box by mistake, then I would have to go back in to
the table to reset it. I got around this by adding a new button which is the
only enabled control on the form, which is visible only if the checkbox =
true, and then having a confirmation dialog box ("Are you SURE you want to
change the status of this job?"

This works fine in my app, but Debra wanted to allow this via security - how
would one set that up? (Assuming, of course, that you already have Access
Security enabled)

TIA,

SusanV




"Al Camp" wrote in message
...
Debra,
Add a new field to the table for your subform (ex. chkLocked -
True/False), and place it your subform.
On the AfterUpdate event of chkLocked use this code...
If chkLocked = True then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
End If
*Use this same code on the OnCurrent event of the subform record.

That should do it...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"Debra" wrote in message
...
I want to be able to lock records for editing in a subform by using a
checkbox, i.e. when the checkbox is unchecked the current record on the
subform can still be edited, when the checkbox is checked the record can
only
be viewed, not edited. I would also like to attach some kind of password
control to the checkbox to prevent users from unchecking the chkbox to
amend
data.






  #5  
Old March 20th, 2006, 05:48 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How to lock record edits on a subform using a checkbox

Susan,
Sorry I missed your post until now...
Well, I don't think Debra meant using the Access security system... just
a simple "password" type check (key users would have this password) before
allowing the chk update. That password would remove the AllowEdits = No.
If you wanted to use Access security, a simple method would be to create
a pop-up form to check uncheck the checkbox. That form could be secured in
Access security to only those users allowed to do so.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"SusanV" wrote in message
...
Al,

I use a similar checkbox for completed jobs to prevent users from
inadvertently changing data once the record should be "finalized" -
however, if someone checks that box by mistake, then I would have to go
back in to the table to reset it. I got around this by adding a new button
which is the only enabled control on the form, which is visible only if
the checkbox = true, and then having a confirmation dialog box ("Are you
SURE you want to change the status of this job?"

This works fine in my app, but Debra wanted to allow this via security -
how would one set that up? (Assuming, of course, that you already have
Access Security enabled)

TIA,

SusanV




"Al Camp" wrote in message
...
Debra,
Add a new field to the table for your subform (ex. chkLocked -
True/False), and place it your subform.
On the AfterUpdate event of chkLocked use this code...
If chkLocked = True then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
End If
*Use this same code on the OnCurrent event of the subform record.

That should do it...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"Debra" wrote in message
...
I want to be able to lock records for editing in a subform by using a
checkbox, i.e. when the checkbox is unchecked the current record on the
subform can still be edited, when the checkbox is checked the record can
only
be viewed, not edited. I would also like to attach some kind of
password
control to the checkbox to prevent users from unchecking the chkbox to
amend
data.







  #6  
Old March 20th, 2006, 06:07 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How to lock record edits on a subform using a checkbox

Thanks for replying Al - after I sent my response I realized that's what I
would nee to do - check user then if user is allowed, open the popup I have
now to change the checkbox, if user is not allowed, popup a insufficient
rights dialog.



"Al Camp" wrote in message
...
Susan,
Sorry I missed your post until now...
Well, I don't think Debra meant using the Access security system... just
a simple "password" type check (key users would have this password) before
allowing the chk update. That password would remove the AllowEdits = No.
If you wanted to use Access security, a simple method would be to create
a pop-up form to check uncheck the checkbox. That form could be secured
in Access security to only those users allowed to do so.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"SusanV" wrote in message
...
Al,

I use a similar checkbox for completed jobs to prevent users from
inadvertently changing data once the record should be "finalized" -
however, if someone checks that box by mistake, then I would have to go
back in to the table to reset it. I got around this by adding a new
button which is the only enabled control on the form, which is visible
only if the checkbox = true, and then having a confirmation dialog box
("Are you SURE you want to change the status of this job?"

This works fine in my app, but Debra wanted to allow this via security -
how would one set that up? (Assuming, of course, that you already have
Access Security enabled)

TIA,

SusanV




"Al Camp" wrote in message
...
Debra,
Add a new field to the table for your subform (ex. chkLocked -
True/False), and place it your subform.
On the AfterUpdate event of chkLocked use this code...
If chkLocked = True then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowDeletions = True
End If
*Use this same code on the OnCurrent event of the subform record.

That should do it...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"Debra" wrote in message
...
I want to be able to lock records for editing in a subform by using a
checkbox, i.e. when the checkbox is unchecked the current record on the
subform can still be edited, when the checkbox is checked the record
can only
be viewed, not edited. I would also like to attach some kind of
password
control to the checkbox to prevent users from unchecking the chkbox to
amend
data.








 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to lock individual record after a feild in a subform is populated. Minal Shah General Discussion 0 February 25th, 2006 11:02 AM
Current date in last subform record BruceM Using Forms 5 October 11th, 2005 01:12 PM
Need Help In Printing Current Record in Specific Report RNUSZ@OKDPS Setting Up & Running Reports 1 May 16th, 2005 09:06 PM
Checkbox Chip1035 Using Forms 9 April 6th, 2005 10:19 PM
Prevent Blank Records being written. Need Help. Robert Nusz @ DPS Using Forms 4 December 29th, 2004 05:15 PM


All times are GMT +1. The time now is 05:54 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.