I want to prevent accidental updates to records

  • Thread starter Thread starter Michael Fine
  • Start date Start date
M

Michael Fine

I am running Access 2000.

I would like to put a simple check box on a form so that if the box is
checked that record cannot be edited. If you uncheck the box, the
record can be edited.

Is there a simple way to do this.

TIA
 
Yes.

On the open form property, set the check box to 0.

On the 'on click' property of the check box, check the
state of the box and use myForm.AllowEdits = True or
False accordingly.

HTH

John C
 
I am running Access 2000.

I would like to put a simple check box on a form so that if the box is
checked that record cannot be edited. If you uncheck the box, the
record can be edited.

Is there a simple way to do this.

TIA

Yes; a little bit of code in the Form's BeforeUpdate event will do the
trick. Open the form in design view, put an unbound checkbox named
chkOKTosave on it. Then view the Form's Properties, and find the
"Before Update" property on the Events tab; click the ... icon by it
and choose the Code Builder. The code should be something like:

Private Sub Form_BeforeUpdate(Cancel as Integer)
If Me!chkOKToSave = False Then
MsgBox "Review your work, then check the OK To Save box"
Cancel = True
End If
End Sub
 
Back
Top