Prevent Inadvertent Editing of Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am a software trainer who is relatively new to Access 2003. I met with a
department head who’s very concerned about her people, who are not proficient
with Access, browsing through records and inadvertently changing data. She
wants to set up Access 2003 so they must make an affirmative action to save
edits/changes such as clicking on a SAVE button.

I know this was easy to do in a program called Alpha Five that I’ve used for
years, can we do the same with Access to prevent inadvertent edits? And if we
can, how would we set this up?

Thanks,
Robert
 
Robert, use the BeforeUpdate event procedure of your form for confirmation:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Save?", vbYesNo) = vbNo Then
Cancel = True
'Me.Undo
End If
End Sub

If you like you can set the form's AllowEdits and AllowDeletions properties
to No so the user does not accidentally change something.

Unfortunately, that prevents you using unbound controls as well, so if you
use a combo or text box to navigate or filter the form, you need to set the
Locked property of the controls instead. If you need to do that and possibly
handle subforms as well, see the code in this article:
Locking bound controls on a form and subforms
at:
http://allenbrowne.com/ser-56.html
 
Hi Allen:

Thanks for info, it looks as if that's exactly what we need. If I have any
problems implementing your suggestions, I'll post it here.

Thank again,
Robert
 
Back
Top