Results 1 to 9 of 9
  1. #1
    Evans2 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jul 2014
    Location
    Seattle
    Posts
    27

    Run-time error 2046


    Hi all,

    Hoping you can help me with this error message that is driving me nuts.

    I'm using a split form and I continue to get this Run-time error 2046 message. The problems seems to be with my DoCmd.RunCommand acCmdRecordsGoToLast code I have in the on load event.

    The really strange thing is that the error message only pops up maybe 1 out of 20 times the database is opened. I've tried to find the solution but haven't had any luck because the error is so inconsistent.

    Any help would be GREATLY appreciated. Screenshots below.



    Thank you,




    Evan
    Attached Thumbnails Attached Thumbnails DoCmd.jpg   GotoLastRecordError.jpg  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Has to be a cause. Need to document exact circumstances for each occurrence.

    Could try alternative code:

    Docmd.GoToRecord acDataForm, "form name", acLast
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Or even

    DoCmd.GoToRecord , , acLast

    I think June7's idea is a good one; to be honest I've never seen or heard of

    acCmdRecordsGoToLast

    and some commands have have problems at certain times/situations, even though they should work.

    The other possibility, especially given the sometimes it errors, sometimes it doesn't, is that there is corruption afoot.

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

    All posts/responses based on Access 2003/2007

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Seems I've read that DoCmd.RunCommand method is supposed to be 'old school' (deprecated), not recommended.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Evans2 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jul 2014
    Location
    Seattle
    Posts
    27
    Thanks so much! This seems to have done the trick (for now).

  6. #6
    Evans2 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jul 2014
    Location
    Seattle
    Posts
    27
    Damn! It just happened again. I seems itīs not resolved after all. Iīll keep searching for a solution.

  7. #7
    Evans2 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jul 2014
    Location
    Seattle
    Posts
    27
    Thanks Missinglinq. It seems you may be right and there is some kind of corruption going on. I tried trying to recreate the error on an older, unsplit version of my database and the error doesnīt occur. How can I find the cause? A bit desperate to fix this as there are many people using the database.

  8. #8
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by Evans2 View Post

    ...It seems you may be right and there is some kind of corruption going on...

    ...How can I find the cause?
    Ouija board? Crystal ball? Gypsy fortuneteller? With a few exceptions, such as corruption of a Control, it is almost impossible to pinpoint the cause of corruption.

    The usual first method of attack is to re-create the errant Form. If this would be too onerous a task, create a new, blank database and import all objects from the errant file into the new one. This would be my suggestion, at this point in time.

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

    All posts/responses based on Access 2003/2007

  9. #9
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Looks like the VBA project might be starting to corrupt, If you edit the VBA while in single step debug mode, you can cause corruption of the VBA project.
    Been there, done that, managed to survive!

    If Linq's suggestion doesn't fix the problem, here is the steps I used to recover. Don't wait too long... at some point your dB might not even open.

    See post #2 at https://www.accessforums.net/access/...ect-41760.html

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

Similar Threads

  1. Replies: 13
    Last Post: 02-04-2013, 04:08 AM
  2. Replies: 13
    Last Post: 10-19-2012, 06:34 AM
  3. Replies: 0
    Last Post: 07-16-2012, 05:42 AM
  4. Replies: 3
    Last Post: 06-09-2012, 08:14 AM
  5. Replies: 5
    Last Post: 03-30-2010, 12:53 PM

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