Confirm change, but not on new record

  • Thread starter Thread starter Terri
  • Start date Start date
T

Terri

I have a confirmation message that I present when on the Before_Update event
of a field.

If MsgBox("Do you want to modify the accrual per day amount?", vbYesNo) <>
vbYes Then
Cancel = True
Me.Undo
End If

I only want to present this when an existing record is being modified. If a
new record is being created I don't want to present this message.

I tried If statements like:

If Not IsNull(Me.AccrualAmount) Then
and
If Me.AccrualAmount > 0 Then

but these did not work.

How can I prevent this message when users are entering in new records.

Thanks
 
Forms have a NewRecord property:

If Not Me.NewRecord Then
' This is not a new record. Have user confirm changes.
If MsgBox......

End If
End If

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top