Checking for new record

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I need to validate a field in after update but only if it is a new record
and not an exiting record. How can I check for a new record in after update
event of a field?

Thanks

Regards
 
John said:
Hi

I need to validate a field in after update but only if it is a new record and
not an exiting record. How can I check for a new record in after update event
of a field?

If Me.NewRecord Then...
 
For validation purposes the form's BeforeUpdate event procedure would be
better as this has a Cancel argument whose return value can be set to True,
e.g.

If Me.NewRecord Then
If Not <validation criterion> Then
MsgBox "Your Message", vbExclamation, "Warning"
Cancel = True
End If
End If

Ken Sheridan
Stafford, England
 

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