Detect is record is new

  • Thread starter Thread starter scott
  • Start date Start date
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?
 
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.
 
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.
 
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.
 
In the On Current Event...

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

This works in Access 2000, XP, and 2003
 

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