Results 1 to 2 of 2
  1. #1
    swavemeisterg is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    28

    Run-time error '2105': You can't go to the specified record.

    I have a "Save and New" button on my form which essentially adds a new record.
    Here's the code:



    Code:
    Private Sub Command480_Click()
    DoCmd.GoToRecord , , acNewRec
    With Me.RecordsetClone
    .MoveLast
    When I click the button, an error pops up saying Run-time error '2105': You can't go to the specified record.
    When I debug, it highlights the DoCmd line (DoCmd.GoToRecord , , acNewRec)

    Last time I used the form (3 days ago), everything was working fine. No idea what the problem is.

    Thanks in advance!

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    IF you simply want to go to a New Record, what is this
    Code:
    With Me.RecordsetClone
    .MoveLast
    supposed to be doing? The single line

    DoCmd.GoToRecord , , acNewRec

    should do what you're trying to do. I'd simply try that line by itself.

    BTW, in using Access for the past 12 years, one thing that I've seen, repeatedly, is that the Access Gnomes frequently do not actually hilight the errant line of code, but rather the line of code before the problem one! That would mean that the problem line, here, would be the
    Code:
    With Me.RecordsetClone
    .MoveLast
    part. Also, where is the rest of the OnClick sub?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  2. Replies: 5
    Last Post: 03-27-2012, 01:40 PM
  3. Replies: 2
    Last Post: 01-05-2012, 04:23 AM
  4. Replies: 4
    Last Post: 07-22-2011, 12:52 PM
  5. Replies: 2
    Last Post: 12-23-2010, 09:11 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
  •  
Other Forums: Microsoft Office Forums