Results 1 to 4 of 4
  1. #1
    Rdiamond is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Dec 2015
    Posts
    4

    Subform properties, Access 2013, error 2467

    I'm in the process of upgrading a database written by someone else; it was originally in Access 97 format, now I have gotten it to work perfectly in Access 2007. However, when I try to open it in Access 2013, I get "error 2467, The expression you entered refers to an object that is closed or doesn't exist."

    The error occurs on this line of code:
    Code:
    SH = Me.Subform0.Height / Me.Subform0.Form.Section(0).Height
    Right below that is this line:
    Code:
    SW = Me.Subform0.Width / Me.Subform0.Form.Width
    When I mouse over 'Me.Subform0.Width' (after the error), it shows 'Me.Subform0.Width = 8206'

    Going back to Access 2007 (same database file, same directory), adding a breakpoint shows the same value for 'Me.Subform0.Width', and values for the other 3 properties:
    Me.Subform0.Height = 5276, Me.Subform0.Form.Section(0).Height = 4755, and Me.Subform0.Form.Width = 10860.

    So Access 2013 is doing something different in processing these lines, which causes the error. Any ideas how to fix?

    This is part of a thread posted in the 'Modules' forum for a different problem


  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,815
    Not sure why you would want height of subform. Perhaps you really need height of the subform container control. Is Subform0 name of form or the subform container?
    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
    Rdiamond is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Dec 2015
    Posts
    4
    This was written by someone else, I just need to get it working in Access 2013.
    The name of the subform is frmMember, so I guess Subform0 is what you are calling the subform container. In the Locals window (back in Access 2007 again), Controls -> Item 3 has ControlName = Subform0.
    When I go the property sheet of the parent form (eza_SwitchboardLook) in Design View, I see an entry for Subform0. The 'Other' tab -> Name shows Subform0, and the 'Data' tab -> Source Object is frmMember.
    I read in another thread that the correct syntax is to use the control name (Subform0) and reference it using Forms!ParentForm!ControlName, so I changed the first line of code to:
    Code:
    SH = Forms!eza_SwitchboardLook!Subform0.Height / Forms!eza_SwitchboardLook!Subform0.Form.Section(0).Height
    This also works in Access 2007, yet still the same error in Access 2013. Then I tried substituting 'frmMember' instead of Subform0 on this line - that gives the same error in Access 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,815
    If you want height of the container:

    Me.Subform0.Height

    However, your original code works for me.

    Cannot explain why your 2013 fails. Have you tried another computer running 2013?

    Post complete procedure code or provide db for analysis. Follow instructions at bottom of my post.
    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.

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

Similar Threads

  1. Error 2013 Access
    By mfmalthaf in forum Modules
    Replies: 3
    Last Post: 06-11-2015, 06:38 AM
  2. Access 2013 subform not display records
    By raphael99 in forum Programming
    Replies: 8
    Last Post: 04-13-2015, 02:48 PM
  3. Replies: 2
    Last Post: 03-13-2015, 09:11 AM
  4. Error 2467
    By Ray67 in forum Forms
    Replies: 1
    Last Post: 01-26-2013, 11:41 PM
  5. Replies: 1
    Last Post: 02-25-2011, 11:32 AM

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