Results 1 to 6 of 6
  1. #1
    snoopy2003 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    72

    docmd.openform Invalid database object reference

    Hello,

    I have a problem and I hope you will agree to help me.

    After modifying database links (front end to new backend),
    one form does not open and generated reference error 3276.

    I open the form by clicking on tree control node.
    but It does not open directly from DB window.

    but, If I compact & Repair the file it opens correctly.



    What should I do in order to ovoid this error ?

    Thank you for your help

    Code:
    Private Sub menuTree_Click()
           Dim strcrit As String
           stricrit = menuTree.SelectedItem.Key
           DoCmd.Close
           DoCmd.OpenForm stricrit
    End Sub
    Last edited by snoopy2003; 03-15-2011 at 03:38 AM.

  2. #2
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    705
    Try:

    Code:
    Private Sub menuTree_Click()
          Dim strcrit As String
          stricrit = menuTree.SelectedItem.Key
          DoCmd.OpenForm stricrit
    
          Docmd.Close acForm,Me.Name
    
    End Sub
    Boyd Trimmell aka Hitechcoach
    Database Architect and Problem Solver
    Microsoft MVP - Access Expert
    25+ years specializing in Accounting, Inventory, and CRM systems
    "If technology doesn't work for people, then it doesn't work."

  3. #3
    snoopy2003 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    72
    Hello,

    Thank you for your help. I changed the code but it did not solve the problem.

    If I try to open the form directly from the DB window I get:"
    Invalid Database object reference".

    If I try to open the form in design view and then and then in form view it works.

    After Compact and repair it works with no error in all cases.

    What am I doing wrong ?

    Thank you for your help

  4. #4
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    705
    Some other things to try:

    1) De-compile the VBA using /decompile

    2) Export the objects having issues. Delete them. Restore them. See: Backing up and Restoring Objects

    3) Create a new blank database and import all the object.


    Could be an Access 2010 issue. I am waiting on SP1 before I consider using it in production.
    Last edited by HiTechCoach; 03-15-2011 at 09:13 AM.
    Boyd Trimmell aka Hitechcoach
    Database Architect and Problem Solver
    Microsoft MVP - Access Expert
    25+ years specializing in Accounting, Inventory, and CRM systems
    "If technology doesn't work for people, then it doesn't work."

  5. #5
    snoopy2003 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    72
    Hello,

    Thank you for your help. Backup & restore solved my problem.

    Thank you for your support, It is the main form of my
    application and I could not find a solution.

  6. #6
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    705
    You're welcome.

    Glad I could assist.


    Boyd Trimmell aka Hitechcoach
    Database Architect and Problem Solver
    Microsoft MVP - Access Expert
    25+ years specializing in Accounting, Inventory, and CRM systems
    "If technology doesn't work for people, then it doesn't work."

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

Similar Threads

  1. Docmd.form cause reference error
    By snoopy2003 in forum Programming
    Replies: 0
    Last Post: 03-10-2011, 10:49 AM
  2. What actually happens at docmd.openform
    By Beorn in forum Programming
    Replies: 4
    Last Post: 01-05-2011, 02:19 PM
  3. OLE object not written to database
    By Jean-Louis Leroy in forum Forms
    Replies: 0
    Last Post: 06-08-2010, 02:08 AM
  4. "doCmd - can't find object"
    By drmcfall in forum Access
    Replies: 1
    Last Post: 08-18-2009, 09:41 PM
  5. DoCmd.OpenForm Modification
    By alsoto in forum Forms
    Replies: 6
    Last Post: 05-01-2009, 07:28 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