Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help - End of a Recordset

Status
Not open for further replies.

regava

Programmer
May 24, 2001
152
US
While executing the ADDRECORD command I get the following message from Access(97): "You can't go to the speciedif record. You may be at the end of a recordset." The form were this takes place is link to a table.
Following is the code for the function used by the command and the command itself:
=======================================================
Function Message(strAction As String) As Long
Dim strMsg As String

strMsg = "Do you want to " + Trim(strAction) + " this Record?"
Message = MsgBox(strMsg, lngDisp, strTitle)

End Function
=======================================================
Private Sub cmdAddRecord_Click()
On Error GoTo Err_cmdAddRecord_Click

If Message("ADD") = vbYes Then

[CreateDate] = Date
[UpdateBy] = "Admin"
DoCmd.GoToRecord , , acNewRec
MsgBox "Representative Added to this Petition.", , strTitle

Else

Me![cmbRepsId].SetFocus

End If

Exit_cmdAddRecord_Click:
Exit Sub

Err_cmdAddRecord_Click:
MsgBox Err.Description
Resume Exit_cmdAddRecord_Click

End Sub
=======================================================
I use the same methodology in other forms and tables and do not have this problem.
Any help is greatly appreciated.
Rene
 
I ran the code on a test form and could only reproduce the error if I failed to fill in one of the required fields. Is it possible that is what is happening?
Good Luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top