if at new record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

using code, how do check if the record u are current editing is a new record
rather than editing an existing one, when in a form
 
Patrick said:
using code, how do check if the record u are current editing is a new
record rather than editing an existing one, when in a form

If Me.NewRecord = True Then...
 
To expand a little more on Rick's solution, you can simply put:

If Me.NewRecord Then
' do something here
End If

Because Me.NewRecord evalutes as boolean, it meets the syntax criteria of
the If-Then statement:

If <condition> Then
End IF

By removing the "=True" part, you are actually saving some time on
processing.

Just food for thought...

Rob Mastrostefano

--
FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com
 
Back
Top