R
Rekha
Hi,
I have an input form with a new button and submit button.
When I click on New button, I get a Run time error 2105, "Can't go to
the specified record. You may be at the end of the recordset". But the
recordset is not at the end. It shows me the form filled with already
existing record. It is not clearing the fields and not allowing me to
enter anything.
Please help me in this.
Thanks in advance..
Rekha
My code goes here...
Private Sub Form_Open(Cancel As Integer)
Forms!MPD!tbUser = gUser
If (Me.RecordsetClone.RecordCount > 0) Then
Forms!MPD.RecordsetClone.MoveLast
tbNumRecords.Value = Forms!MPD.RecordsetClone.RecordCount
Forms!MPD.RecordsetClone.MoveFirst
tbRecord.Value = Forms!MPD.CurrentRecord
End If
Me!ProjNum.Enabled = False
Forms!MPD.AllowAdditions = True
End Sub
Private Sub Form_AfterDelConfirm(Status As Integer)
tbRecord.Value = Me.CurrentRecord
tbNumRecords.Value = Me.RecordsetClone.RecordCount
End Sub
Private Sub Form_AfterInsert()
tbRecord.Value = Me.CurrentRecord
tbNumRecords.Value = Me.RecordsetClone.RecordCount
End Sub
Private Sub btnNewRequest_Click()
On Error GoTo Err_btnNewRequest_Click
DoCmd.GoToRecord , , acNewRec ' ----------> Error Message in this line
Exit_btnNewRequest_Click:
Exit Sub
Err_btnNewRequest_Click:
MsgBox Err.Description
Resume Exit_btnNewRequest_Click
End Sub
I have an input form with a new button and submit button.
When I click on New button, I get a Run time error 2105, "Can't go to
the specified record. You may be at the end of the recordset". But the
recordset is not at the end. It shows me the form filled with already
existing record. It is not clearing the fields and not allowing me to
enter anything.
Please help me in this.
Thanks in advance..
Rekha
My code goes here...
Private Sub Form_Open(Cancel As Integer)
Forms!MPD!tbUser = gUser
If (Me.RecordsetClone.RecordCount > 0) Then
Forms!MPD.RecordsetClone.MoveLast
tbNumRecords.Value = Forms!MPD.RecordsetClone.RecordCount
Forms!MPD.RecordsetClone.MoveFirst
tbRecord.Value = Forms!MPD.CurrentRecord
End If
Me!ProjNum.Enabled = False
Forms!MPD.AllowAdditions = True
End Sub
Private Sub Form_AfterDelConfirm(Status As Integer)
tbRecord.Value = Me.CurrentRecord
tbNumRecords.Value = Me.RecordsetClone.RecordCount
End Sub
Private Sub Form_AfterInsert()
tbRecord.Value = Me.CurrentRecord
tbNumRecords.Value = Me.RecordsetClone.RecordCount
End Sub
Private Sub btnNewRequest_Click()
On Error GoTo Err_btnNewRequest_Click
DoCmd.GoToRecord , , acNewRec ' ----------> Error Message in this line
Exit_btnNewRequest_Click:
Exit Sub
Err_btnNewRequest_Click:
MsgBox Err.Description
Resume Exit_btnNewRequest_Click
End Sub