Detect is record is new

S

scott

Is there a way to test if a record is brand new? i've got a combo box that
jumps to records when changed and wanted to clear it or requery it if the
record is a brand new record.

Maybe check a few fields to see if they are empty in the On Current event?
 
M

Marshall Barton

scott said:
Is there a way to test if a record is brand new? i've got a combo box that
jumps to records when changed and wanted to clear it or requery it if the
record is a brand new record.

Maybe check a few fields to see if they are empty in the On Current event?


Check the form's NewRecord property.
 
B

Brendan Reynolds

The form has a built-in property for that ...

If Me.NewRecord Then
'its a new record
Else
'its not
End If

Provided, that is, you are using any version of Access later than Access 2!
:) Checking required fields for Null values is how we *used* to have to do
it way back then.
 
R

RuralGuy

Is there a way to test if a record is brand new? i've got a combo box that
jumps to records when changed and wanted to clear it or requery it if the
record is a brand new record.

Maybe check a few fields to see if they are empty in the On Current event?

If Me.NewRecord Then
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

Rick Roberts

In the On Current Event...

If Me.Newrecord then
....
....
End if

This works in Access 2000, XP, and 2003
 
Top