Results 1 to 5 of 5
  1. #1
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150

    Inconsistent Run-time error 2467 referencing control that definately exists

    Hi guys,

    I have a weird one for you. I have a form which has a hidden textbox called txtHiddenID. In the unload event of this form I have code that checks to see if this textbox is null



    Code:
     if not isnull(Me.txtHiddenID) then  
        ' bla do stuff
    End If
    When I put the form into design mode the first time after it has been opened, the if line of code throws a 2467 error (object is closed or doesn't exist). If I hit "End" on the error message to exit the code and then try and change the form to design mode again, it works fine. No error. It's not a huge problem as it never seems to throw the error when you close the form through the close button so if you're as stumped as me that's fine, but I'd be really interested to know if anyone has any ideas what could be going on.
    Last edited by Robyn_P; 01-25-2019 at 09:19 AM. Reason: Formatting

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    what event is this code in?

  3. #3
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    It's in the unload event.

    It's an unbound form for data entry which has a subform and this field is used to link the subform records. Not sure if that's relevant.

  4. #4
    dashiellx's Avatar
    dashiellx is offline Falconer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    Baltimore
    Posts
    49
    Quote Originally Posted by Robyn_P View Post
    It's in the unload event.

    It's an unbound form for data entry which has a subform and this field is used to link the subform records. Not sure if that's relevant.
    Are there any records on the subform? If there are no records in the subform, then the subform object does not exist-that might have something to do with it.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Quote Originally Posted by Robyn_P View Post
    It's in the unload event.

    It's an unbound form for data entry which has a subform and this field is used to link the subform records. Not sure if that's relevant.
    Likely is, but without seeing your db impossible to say for sure. You might have a calculated control, or linked controls/fields (between main and subform) that has a reference that cannot be resolved because of the order of events. For example, a subform loads before a main form, so if you try to reference a main form during subform load, the main form isn't open so you can expect an error. Your solution might be to place your code elsewhere.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 15
    Last Post: 05-12-2016, 02:27 PM
  2. Subform properties, Access 2013, error 2467
    By Rdiamond in forum Forms
    Replies: 3
    Last Post: 12-15-2015, 12:22 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. VBA Referencing Subform Control Error 2465
    By Jester0001 in forum Programming
    Replies: 3
    Last Post: 05-30-2012, 07:31 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