Form mode "Create" v. "Revise"

Jwy

Registered User.
Local time
Today, 17:56
Joined
Sep 19, 2005
Messages
10
Is there a way I can tell if a form is in "Create" mode v. "Update" mode"? I want to send an email when a form is being Created, but not when a form is being Updated. Currently I'm sending an email everytime the form is saved...this is nonsense. Any help is appreciated.
 
In the BeforeUpdate event of the form, you can check the NewRecord property.

Code:
If Me.NewRecord Then
    'send Email
End If

It is actually safer to put the code in the form's AfterUpdate event because that way the record has really been saved but the NewRecord property will no longer test true at this point so you need to create your own variable. Set it in the BeforeInsert event, check it in the AfterUpdate event, and reset it in the Current event.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom