Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150

    Runtime error 2467 when going into design view anyway

    Hello all, I'm stumped. I have a form with a hidden textbox and in the form unload event I check whether this is null. When I close the form using the x button or through the [Close] command button I've created all works fine, when I right click and go into design mode, the isNull statement errors with a run-tim 2467 object does not exist. I have no idea why. Any suggestions? I can add error catching code to ignore the warning but I would rather know why it is being triggered in the first place.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I tried to replicate this issue and cannot. Post your code or provide db for analysis.
    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
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    I can't post the database, it's huge and the work system won't let me. The code that errors is [code]If Not IsNull(Me.txtHiddenID) Then[\code]

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I tried that and does not error. Is there more code?

    Use forward slash in CODE tag.
    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.

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    You will have to check for the state of the form

    https://docs.microsoft.com/en-us/off...rm.currentview

    you should only perform your code if the currentview is non zero (though I would limit it specifically to form view myself)

  6. #6
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    By any chance is there a subfom involved, or the form close button is disabled?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    The form close button is disabled and there is a subform. How could that be affecting it?

  8. #8
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Does your form contain a Web browser control.
    I find changing to design view can cause an error in that situation.
    If t helps, this is the error I have seen ...
    Attached Thumbnails Attached Thumbnails Capture.PNG  
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  9. #9
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,421
    Quote Originally Posted by Robyn_P View Post
    The form close button is disabled and there is a subform. How could that be affecting it?
    The day I asked that question I had found a forum where it was indicated that this can happen under those conditions (or so I seem to recall). It's been too long now so I can't remember why or what the fix might have been. Sorry.
    Maybe you can find it if Colin's post doesn't help. I know that a subform opens before the main, so referring to a main field in subform load will cause issues. Don't recall if it also closes first. Maybe research that (or put a msgbox in both unload events so you can know which closed first) in case there's a connection between 2 forms that's causing it.

  10. #10
    tkazi is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2024
    Posts
    14
    Hi Resurrecting this old thread, I encountered this issue and don't know how to solve it. Please find a test database at https://drive.google.com/file/d/1BEV...ew?usp=sharing. I am using Office365. If you open form "Foo" you can close the form and go to design mode, no problem. But if you open form "Foo2" you can only close it but will get an error if you go to design mode. Only difference if the name of the field "VerseId" vs "VersId". If you change the name of this field in table table Foo you will not have the error anymore while if you change the field name to VerseId in Foo2 table, you will start getting the problem :-(. Following is where the DB is:

    https://drive.google.com/file/d/1BEV...ew?usp=sharing

    Tauseef

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Post 10 was moderated, I'm posting to trigger email notifications.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    tkazi is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2024
    Posts
    14
    Quote Originally Posted by pbaldy View Post
    Post 10 was moderated, I'm posting to trigger email notifications.
    Thanks Paul.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Using Access 2010.

    Not getting error with posted db.

    Usually best to start a new thread and reference the old one if you think it would be helpful. New threads get more attention.
    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.

  14. #14
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    Quote Originally Posted by June7 View Post
    Using Access 2010.

    Not getting error with posted db.

    Usually best to start a new thread and reference the old one if you think it would be helpful. New threads get more attention.
    And people don't have to read down a long thread only to get to the bottom and realize it's an old thread
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  15. #15
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    You have the following code in your Form_Unload event:

    Code:
    Private Sub Form_Unload(Cancel As Integer)   
     If [VersId] = 1 Then
        End If
    End Sub
    If you change the field name without updating the form design to match it, you will get error 2465: Microsoft Access can't find the field '|1' referred to in your expression
    This will of course prevent you closing the form unless you update the code to match the new field name

    However the code is pointless as written. Adding the line Cancel = True after Then will prevent the form closing without raising an error
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error 2467 When Trying to Reach Report Controls
    By 123noob in forum Programming
    Replies: 5
    Last Post: 03-21-2019, 05:34 AM
  2. Replies: 2
    Last Post: 03-13-2015, 09:11 AM
  3. Replies: 8
    Last Post: 04-29-2013, 11:23 AM
  4. Error 2467
    By Ray67 in forum Forms
    Replies: 1
    Last Post: 01-26-2013, 11:41 PM
  5. Runtime 2467 only on a Win 7 Machine
    By ilikebirds in forum Forms
    Replies: 3
    Last Post: 12-11-2012, 03:58 PM

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