My data entry form wont allow me to add a new record. It brings up an error on the DoCmd.GoToRecord , , acNewRec line. The form is set to Allow Additons and Data Entry to Yes. I thought that it may have been not saving the record properly but after inserting the save record command it has saved to the table as expected. validAddForm is a function that holds my validation rules and is tested in the Before_Update of the form. If true, then the record has passed validation.
I can't work out why this "You can't Go to the specified record" error is happening! All help is most appreciated as always!
Expand|Select|Wrap|Line Numbers
- Private Sub cmdAddFile_Click()
- Dim intResponse As Integer
- If validAddForm = True Then
- DoCmd.RunCommand acCmdSaveRecord
- DoCmd.GoToRecord , , acNewRec
- Else
- MsgBox "This record is incomplete." & vbCrLf & "You have not included:" & vbCrLf & strInvalid, vbExclamation + vbOKOnly, "Adding Record: Incomplete"
- End If
- End Sub