Results 1 to 5 of 5
  1. #1
    ineuw's Avatar
    ineuw is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jun 2015
    Location
    Canada
    Posts
    33

    Cannot get rid of a 2950 error

    I am an Access 2003 VBA user and recently I switched to MS Office & MS Access 2007. I have a series of VBA functions, the first of which is a public function named fnEmptyAll() which initiates a series of private functions all within a single module. The public function itself is initiated by the Run macro RunCode =fnEmptyAll(). I wrote a new private VBA function and added it to the same module as the old functions. All the functions which existed in the 2003 version work fine, but when it reaches the new function it stops and reports a 2950 error, which is about trust. However, I set the macro security to none, and added the folder of the database (.mdb) to the list of trusted sites. And, I don't know what else I need to do about it. Also in version 2003, I was able to initiate the functions independently in the module by using the [Step Into F8] and [Step out] tools, but this option no longer works. Can someone please help and point to the errors of my ways.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    Create an AutoExec macro that does something like open a form or message box. It the issue is a Trust issue, the macro won't run. However, you need certain macro settings:

    https://support.microsoft.com/en-ca/kb/931407
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    ineuw's Avatar
    ineuw is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jun 2015
    Location
    Canada
    Posts
    33
    Micron, thanks for the direction. I had an Autoexec and some other simple macros, and they all worked fine in the .mdb database run by Access 2007. But that may have been the problem. I was still using a 2002-2003 .mdb format. So, I created an empty .accdb database, in the same folder as the .mdb, and imported everything, and all functions and macros ran properly and completed the task. But at the end, I still got 2950 error, which must have been triggered by some old something in the import. So, as the Microsoft page suggests, I tested it again by creating a new folder, adding it to the trusted site before using it and copied both .mdb and .accdb databases in to this new folder. The results were the same. .mdb failed as before, but .accdb worked fine. However after the completion the 2950 error still popped up.

    I am using DAO, with which I am familiar instead of ADO, because this is a very small project of a few thousand records.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    If this works sometimes, then I believe you are experiencing the same situation as many others where something wonky causes this error to be raised, which really has nothing to do with security and trusted locations. When you think about it, it is either trusted or not, and code should work or not. Some code working sometimes makes no sense from a trust perspective. These statements
    "...all functions and macros ran properly and completed the task. But at the end, I still got 2950 error....mdb failed as before, but .accdb worked fine. However after the completion the 2950 error still popped up." are confusing. I'm not sure which works when or what.
    I was able to initiate the functions independently in the module by using the [Step Into F8] and [Step out] tools, but this option no longer works
    This should still work. There seems to be enough going on here that your best bet might be to post a zipped copy of your db for investigation. From what I've read on this, the issue could be an invalid reference to a custom toolbar/menu bar or invalid reference. I am still using W7 and 2007, so I would be able to keep those variables the same. If not, check those 2 things. Another thing to try is create a form, assign the code to its open event and see what happens.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    ineuw's Avatar
    ineuw is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jun 2015
    Location
    Canada
    Posts
    33

    SOLVED Cannot get rid of a 2950 error

    Micron, thanks for your offer of help. I resolved the issue. Any function that is called by a macro and fails, will trigger the function error message and then the macro 2950 error. In my case, the function failed because it passed .EOF which generated an error 3021. Corrected the problem and all is working well, including the step in/out F8. etc. Thanks again.

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

Similar Threads

  1. Error number 2950
    By azhar2006 in forum Forms
    Replies: 1
    Last Post: 07-08-2014, 03:34 PM
  2. Debug Macro Error 2950
    By DMJ in forum Macros
    Replies: 1
    Last Post: 03-13-2014, 03:12 PM
  3. Replies: 4
    Last Post: 03-07-2013, 12:27 AM
  4. Access Error 2950! Help!
    By qwerty1 in forum Access
    Replies: 3
    Last Post: 09-06-2012, 11:35 AM
  5. error 2950 out of the blue
    By kroenc17 in forum Access
    Replies: 1
    Last Post: 10-08-2010, 10:00 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