Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I tell if I'm on a "new" record in a form?

Status
Not open for further replies.

gaffonso

Programmer
Jul 26, 2001
25
0
0
US
I need to implement some default-setting behavior in a form. For various reasons, I can't use standard field defaults or the DefaultValue property of my controls so I'll need to program the solution.

What's the best way to tell if the current record on a form is a "new" record?

Thanks!

- Gary
 
Er, feeling a little dumb, just answered this for myself.

The NewRecord property of the form will return true if the form is currently displaying a new record. The code would look like this:

If Me.NewRecord Then
' do some stuff based on having a new record
End If

- Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top