last record upon form load

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

Guest

i have a create new button on a form and upon opening of form, i want it to
default to a new (blank) record. how do i do this?
 
This code will open a form as a new record

Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "yourFormName"
DoCmd.Close
DoCmd.OpenForm stDocName, , stLinkCriteria, DataMode:=acFormAdd
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
 
Back
Top