Hi all,
My data entry form wont allow me to add a new record. It brings up an error on the DoCmd.GoToRecor d , , 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!
Edit: When in form view, if I switch to datasheet view and then back into form view, the record can then be added. The acCmdSaveRecord saves the record correctly but then the error pops up saying that it can't go to the next record!
My data entry form wont allow me to add a new record. It brings up an error on the DoCmd.GoToRecor d , , 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!
Code:
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
Comment