Go to first field

C

chrissy2391

I have a pretty basic question. When I'm entering into a form and I leave
off on a field in the middle of the form, say field named Date Needed, when I
click the new record button the cursor is in the field I left previously
(date needed). What I want is when I go to the next new record of the form
the cursor needs to be in the very first field of the form. Hope my rambling
makes some sense.
 
A

Allen Browne

Place a command button on your form.
Put this into its Click event procedure:

Private Sub cmdNew_Click()
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
Beep
Else
RunCommand acCmdRecordsGotoNew
Me.[PutYourControlNameHere].SetFocus
End If
End Sub

If you set the button's Caption to:
&New
you will be able to use Alt+N as a keyboard shortcut.
 
C

chrissy2391

It worked perfectly! Thank you
--
Christine


Allen Browne said:
Place a command button on your form.
Put this into its Click event procedure:

Private Sub cmdNew_Click()
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
Beep
Else
RunCommand acCmdRecordsGotoNew
Me.[PutYourControlNameHere].SetFocus
End If
End Sub

If you set the button's Caption to:
&New
you will be able to use Alt+N as a keyboard shortcut.
 
Top