Is the new record row selected

xcmav66

Registered User.
Local time
Today, 03:28
Joined
Oct 29, 2008
Messages
29
What command can I use to determine (boolean) if the new record row in my form is selected? I'm using DoCmd.RunCommand acCmdRecordsGoToNew, and I only want this code to run if the current record is not the new record row.
 
If Not Me.NewRecord Then DoCmd.RunCommand acCmdRecordsGoToNew
 
if you are in a new record then me.newrecord will be true

try this

Code:
Private Sub Form_Current()
If Me.NewRecord Then
    MsgBox ("New Record True")
Else
    MsgBox ("New Record False")
End If
End Sub
 
As mentioned - the NewRecord property of the form is what you're describing.
However I'd still ask what operation you're performing in the Current event because you're on a new record?
Bearing in mind that the Current event is only navigating to a record. You've not dirtied it yet so edits aren't particularly appropriate.
Default values, however, certainly are. :-)
 

Users who are viewing this thread

Back
Top Bottom