Results 1 to 3 of 3
  1. #1
    hitthenet is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    2

    Run-Time Error 2501 after converting from Access 2003 to Access 2010

    I work on an Access 2003 application that my client wants to convert to Access 2010. Once I converted it, one of the forms, when the code tries to open it, gives me a "run-time error 2501 OpenForm action was canceled. " I have a number of other forms that use the same public call and works fine. But for this particular form it doesn't. The form contains a treeview, subform and tab structure. I haven't changed any code since the conversion although I did notice that a couple of library references are no longer there (DAO 3.6 Object library and Windows common controls (SP6)). In there place, I'm using the Office 14.0 Access database engine Object library
    Here's the code:
    Public Sub SwitchFormCall(NewForm As String, CallingForm As String, CloseMe As Boolean, ReturnToMe As Boolean, Optional Dialog As Boolean)

    Dim c As Collection
    If switchFormCurrentCallCol Is Nothing Then
    Set switchFormCurrentCallCol = New Collection
    End If
    Set c = switchFormCurrentCallCol
    If Not CloseMe Then


    c.Add Forms.item(CallingForm), "SF:Form" 'this puts the actual form object in the collection.
    End If
    c.Add CallingForm, "SF:CallingFormName"
    c.Add NewForm, "SF:CalledFormName"
    c.Add CloseMe, "SF:CloseMe"
    c.Add ReturnToMe, "SF:ReturnToMe"
    If switchFormStack.count = 0 Then
    switchFormStack.Add c
    Else
    switchFormStack.Add c, , 1 'add c to SwitchForm collection before 1
    End If

    'clear switchform calling collection
    Set switchFormCurrentCallCol = Nothing

    If Dialog Then
    DoCmd.OpenForm NewForm, acNormal, , , , acDialog
    Else

    DoCmd.OpenForm NewForm, acNormal

    End If
    If CloseMe Then
    DoCmd.Close acForm, CallingForm
    End If
    Close

    End Sub

    Any ideas as to why a particular form won't work now in Access 2010?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Never tried to use treeview before but....

    Maybe it is the tree view thing. This poster seems to have it working.
    https://www.accessforums.net/access/...box-39334.html

    Maybe this download here will allow you to create the reference needed.
    http://www.microsoft.com/en-us/downl....aspx?id=10019

    I noticed some users were complaining about the treeview not working with 64 bit versions of ACCESS.

  3. #3
    hitthenet is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    2
    Quote Originally Posted by ItsMe View Post
    Never tried to use treeview before but....

    Maybe it is the tree view thing. This poster seems to have it working.
    https://www.accessforums.net/access/...box-39334.html

    Maybe this download here will allow you to create the reference needed.
    http://www.microsoft.com/en-us/downl....aspx?id=10019

    I noticed some users were complaining about the treeview not working with 64 bit versions of ACCESS.
    I found the answer. The treeview is the cause. Access 2007 and 2010 didn't legace the reference library "Microsoft Windows Common controls 6.0(SP6)". There is a way to manually add it the local install by following the directions here: http://support.microsoft.com/kb/2597986
    and then manually add it in the reference library once installed. It works as before.

    Cheers

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

Similar Threads

  1. Replies: 4
    Last Post: 10-10-2013, 01:59 PM
  2. Converting Access Backend from Access 2003 to SQL Question
    By seattlebrew in forum Database Design
    Replies: 0
    Last Post: 03-07-2013, 07:14 PM
  3. Suppressed run time error 2501
    By RachelBedi in forum Programming
    Replies: 8
    Last Post: 10-24-2012, 12:26 PM
  4. 2113 Error happening from Access 2003 to 2010
    By johnnyflames in forum Forms
    Replies: 5
    Last Post: 06-08-2012, 01:42 PM
  5. Replies: 2
    Last Post: 11-10-2009, 02:49 PM

Tags for this Thread

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