Is there a way to lock information that is entered into forms etc.. so when
it is saved it can't be altered without a warning.
Nitpick: information is not entered "into" forms; it's entered into
Tables, using Forms as tools to do so.
That said - you can put VBA code in the Form's BeforeUpdate event to
perform whatever validation you wish; setting the BeforeUpdate
subroutine's Cancel arguement to True will prevent the data from being
added. To be more stringent, you can set the Form's AllowAdditions
property to True and its AllowEdits property to False - this will
allow new records but totally prevent editing of existing ones.
To just pop up a message box (which, in my experience, most users will
find just an annoyance which they will always click without reading):
Private Sub Form_BeforeUpdate(Cancel as Integer)
Dim iAns As Integer
If Not Me.NewRecord Then ' let new records add without checking
iAns = MsgBox("Data has changed; click Yes to accept, " _
& "No to go back to form, Cancel to start over", vbYesNoCancel)
Select Case iAns
Case vbYes ' accept; do nothing
Case vbNo ' stop the update, return to form
Cancel = True
Case vbCancel ' stop update, erase all changes
Cancel = True
Me.Undo
End Select
End If
End Sub
John W. Vinson[MVP]