Results 1 to 2 of 2

Troubleshooting Error: "You can't go to the specified record"

  1. #1
    dipique is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    31

    Troubleshooting Error: "You can't go to the specified record"

    Here's the issue. I have a form that looks up student information. There is a button on the form to add a new student. This has worked just fine for years, but recently stopped working; I'm not sure why.

    Clicking "Add" should add a new record to the "Student Records" table. The VB code behind the button is as follows:

    Code:
    Private Sub btnAdd_Click()
    On Error GoTo Err_btnAdd_Click
    
        DoCmd.GoToRecord , , A_NEWREC
    
    Exit_btnAdd_Click:
        Exit Sub
    
    Err_btnAdd_Click:
        MsgBox Error$
        Resume Exit_btnAdd_Click
        
    End Sub
    When I press it, I receive the error: "You can't go to the specified record. You may be at the end of the recordset." The error is #2105, action GoToRecord (-1,,New,). I am able to manually add a new record to this table; however, although a combobox displaying all records will display the new record, none of the other components on the form will display the new record. In fact, no records added after a certain date will display in the text boxes in the record detail display.

    The size of the DB is about 350MB, and contains 8065 student records. It is formatted as an Access 2002-2003 database and contains some other tables as well.

    Any ideas for me?

    Dan

  2. #2
    orange's Avatar
    orange is online now VIP
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    6,072
    It sounds like you are trying to go to a new records when you are already in the process of a new record.

    Have you tried stepping through your code, or putting some debug statements in your code to see if you are looping more than expected?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-04-2011, 01:45 AM
  2. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 12:43 PM
  3. "No Current Record" error...not sure why it is there
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 01-25-2011, 08:14 AM
  4. Replies: 1
    Last Post: 09-11-2010, 07:21 AM
  5. Error "Record is Deleted"
    By koper in forum Access
    Replies: 8
    Last Post: 03-10-2009, 09:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums