opening forms to a blank record in Access 97

  • Thread starter Thread starter Beeyen
  • Start date Start date
B

Beeyen

I am trying to have Access 97 open up to a blank record to be filled in but
still be able to search for old records using the search or find function.
Currently, if I set the Data Entry to yes, when I open the form it opens to a
blank record but I can not search to bring up a previous record.
 
Leave DataEntry as No.

Add this code the the Event Procedure for the form's Load event:

Private Sub Form_Load()
If Not Me.NewRecord Then
RunCommand acCmdRecordsGotoNew
End If
End Sub
 
Set the Data Entry to No

Then open the forms properties and in the "Open" event procedure place this
code:
DoCmd.GoToRecord , , acNewRec

No when you open the form it will automatically open to a blank record. and
if you want it cursor to automatically blink in the first field try this:
Me.your field name.SetFocus
 
Back
Top