An Idiots Guide to "Runtime error 2467"

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 02:22
Joined
Jul 9, 2003
Messages
17,449
Runtime error 2467
Application-defined or object-defined error

This old friend was back, I was convinced that the computer had a virus! I was convinced that it wasn't me, there was something wrong with the software. After faffing around for about 2 hours it suddenly dawned on me, I was closing the form that the code linked to, causing the error.

In my experience, unusual choice of words here “experience”, this doesn't allude to experience, it alludes to stupidity! Still I do have some excuses, I've got a cold, man flu, so I suppose that accounts for some of the user error.

Yes I know, I admit it, I cocked up, I wasted 2 hours trying to sort out a problem I created myself! Totally convinced that there was something wrong with the computer, not me, I could not make a mistake! That's why I'm writing this, if you're reading this, no it's not your computer generating the error, no it's not your code, your codes working fine.

It's just that you're calling it from the wrong place or you're closing something down with it. What you've probably done is move code from a command button to the on Close event of a form. That's what I did, well not quite as simple as that, I needed a form to test some software and I happen to have a start-up form to hand, and the on Close event of the Startup form opened the next form.

This is what I have been using quite happily in my code, then I decided to add a text box to the Startup form, I decided to pass a reference to that textbox through my code.

Then I close that form.
Yes I know, you should have seen that coming, but no, 2 hours, 2 long frustrating hours, 2 hours of my life wasted because I'm an idiot.

So I'll say it again, no it's not 99%, it's 100%, yes, 100% "It's something you've done!" It's not a virus, it's user error. Yes you are an idiot just like me. Join the club!

F*** it let's go and have a beer!
 
Last edited:
At this time in the morning?! :eek:
 
When I was working on my family tree (still am, but a different phase), I had occasion to build a diagram and Access isn't that good for drawing pictures. However, Excel has this feature called "Smart Art." I have since realized that the word "Smart" is advertising hyperbole 'cause there is not a damned thing smart about it, but that leads to the tie-in to this thread.

I was getting 2467 because I was trying to build a "family tree" diagram with the usual symmetrical binary bifurcation type of branches - left side for males, right side for females - and Smart Art had a template that looked PERFECT for the job. Except that going through the Excel Application object, I kept on getting the 2467 error. I joined an Excel forum and finally got someone who was more familiar with the vagaries of using that feature via VBA.

I was running into the issue that Excel, having a life of its own, didn't LIKE to be manipulated in a way to do incremental SAVE operations. I was building three generations per page (because of size constraints) and when I finished a page, I wanted to save it so that I would be able to see how far I had gotten in case of a crash.

I have since learned that 2467 is considered one of those "catch-all" errors that tells you "something ain't there." It USUALLY means "something ain't open" but could also be "some pointer got dereferenced." I learned about the latter interpretation because I was using object variables (as one does for app objects) across subroutines. This became a lesson in "ByRef" vs. "ByVal" because "ByVal" objects vanish on subroutine exits. I had to be cognizant of where I had created objects. This is also where I learned that you should NEVER create a reference to your external object in a subroutine and expect it to work right. (Pass in the reference as a ByRef object pointer instead, EVEN if the object is in a public variable in a general module.) MANY TIMES I had to clean up leftover worksheets.

I eventually gave up the Smart Art approach and just drew boxes with bold borders and a pink or light-blue back fill. Then I used characters from the WingDing fonts (there are 3 of them) and drew up, down, left, right, or diagonal arrows in cells to represent the visual relationship. That was because as sensitive as basic Excel was to chaotic object pointer issues, Smart Art multiplied that about a gazillion times. The result is not as pretty but it is reliable and machine-drawable.

I would suggest that ANY TIME you are working with app objects, 2467 can creep into your life based on any sloppiness in opening, assigning, deassigning, or closing those objects. And since it is a catch-all of sorts, it COULD even occur if you manually opened a second Access database object since again, object pointers are involved.
 
Been there done that just a few times got all the twat medals lmao
 

Users who are viewing this thread

Back
Top Bottom