how can I do a button that prevent edit ?

eyal7773

New member
Local time
Today, 03:18
Joined
Feb 14, 2008
Messages
4
hello,

I would like your help please.
I build a service calls database on access 2003
and I put in the main table a YES/NO field , that i called it "Finished or not ?"

now I want to add an option that if a user will fill "V" in this check box, all the record will be "locked" , and anyone will not be able to edit this record.

do you know how to do it ?

Thanks
 
in your table have a yesno box called allowedits

in your form, if the box is checked, then set every control to be locked (except the checkbox!)

something like (you will have to set some variables, and play with this)


for each cntrl in frm.controls
cntrl.locked = true (or false)
next ctrl

then run this in the form current event, and in the afterupdate event for ther checkbox.

But how do you stop a user merely changing the flag, and changing stuff anyway?
 
this how I have done this ..

I have hiddne the tickbox on a different tab on the form called admin
but if you truely want it to be once only you could have if tickboxx is true then tickbox.visible=false

this will allow a 1 time tick
 
First off, I wouldn't lock the controls in the AfterUpdate event of the checkbox. The concern here, I expect, is not what the user originating the record does at the time of origination, but rather what the user or someone else might try to do later. So simply use the Form_Current event to lock all the controls, including the checkbox, if the checkbox value is True. That way the locked status of all the controls cannot be changed and the "finished" status of the record is still displayed!

As with all schemes of this nature, thought needs to be given as to how a manager can go in and change something if the need should arise. A strategy I've used successfully in the past is to have a routine to unlock the record and place it behind the click event of a label on the form. Few users realize that labels have click events or would even think to click on one.
 
Sorry, but I'm not a programer

Can you please explain it in more simple words....?
 

Users who are viewing this thread

Back
Top Bottom