Thanks Fred but I am still having a bit of a problem.
First off, I should have mentioned I am using Access 2000 format. Perhaps
this has some bearing on the problem.
I have a "person" form with a command button that should open a "Note" form
to add a new note record.
This is the code for the Current event of my "Note" form:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo ErrHandler
' DoCmd.GoToRecord , , acNewRec
DoCmd.RunCommand acCmdRecordsGoToNew
Exit_ErrHandler:
Exit Sub
ErrHandler:
Debug.Print "ERROR: F_Note.Form_Open"
Debug.Print Now()
Debug.Print "Err.Number: " & Err.Number
Debug.Print "Err.Description: " & Err.Description
Debug.Print "----------------"
MsgBox "Error no: " & Err.Number & _
vbCr & "Description: " & Err.Description
Resume Exit_ErrHandler
End Sub
When I use "DoCmd.GoToRecord , , acNewRec", I get the following error:
ERROR: F_Note.Form_Open
1/9/2005 5:55:18 PM
Err.Number: 2105
Err.Description: You can't go to the specified record.
----------------
When I use "DoCmd.RunCommand acCmdRecordsGoToNew", I get the following error
ERROR: F_Note.Form_Open
1/9/2005 5:59:04 PM
Err.Number: 2455
Err.Description: You entered an expression that has an invalid reference to
the property |.
----------------
If I try to set the open command on the "Person" form with:
DoCmd.OpenForm "FormName", , , , acFormAdd
....nothing seems to happen: the "Note" form opens without error but the
focus is on the first record, not a blank "new" record.
What could I be doing wrong?