Re: Is There A Way to Pop Up a MessageBox Warning When User Changes Data?



I have something similar, but it is set on the entire for. The code runs on the before update.

Here is the code.

Private Sub Form_BeforeUpdate(Cancel As Integer)

'confirm with user that this record is to be modified

Dim updRecord As Byte

  On Error GoTo Form_BeforeUpdate_Error

updRecord = MsgBox("Confirm record change", vbOKCancel, "Record Modification")

If updRecord = vbCancel Then
   Cancel = True

End If

'Dim priordate As Variant
'Dim prioruser As Variant


Me!DateModified = Now() Me!UserModified = CurrentUser()

  On Error GoTo 0
  Exit Sub

Form_BeforeUpdate_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Form_BeforeUpdate of VBA Document Form_Customers"
End Sub


Hope this helps.

"No Spam" <nospam@xxxxxxxxxxxxx> wrote in message news:oh4tt1phmedcnl5mjctkhnd96gl5rn874i@xxxxxxx:

Dear Access 2003 Users,

Is there a way to pop up a MessageBox warning when a user changes data
on a form?  Basically, I have one field that I really want people to
think about before changing, so when they get to that field (which is
the first tab stop on a continuous form), if there is data in it and
they change it, I would love a MessageBox popping up saying "Are you
sure that you want to change XXXX to YYYY?".  If they hit Yes, the
changes are applied, No they revert back to the other data.  Any
ideas?  Thanks!

Kevin

.