Test for New Record

aimeepeter

Registered User.
Local time
Today, 03:20
Joined
May 12, 2008
Messages
11
What is the code to test for a new record?
(I have code that runs on the On Current event of my form, but I don't want the code to run if it is a new record that has not been updated yet because it is creating multiple unwanted blank records.)

Thanks!
 
the code to test is:
Code:
if me.newrecord
but unfortunately, if the code you want to suppress is on the CURRENT event, you've already started running it before you can check for a new record!

you need a way to check if an ACTION that the user is going for BEFORE they get to the new record will result in a new record itself (sort of like pushing a button that says "create new record").
 
possibly a variation on:
if me.newrecord and me.dirty then 'form is edited but not saved

as aje suggests, put your code on the before update, after update or after insert event.
 

Users who are viewing this thread

Back
Top Bottom