?
Solved

Runtime error 2467 Woes PLEASE HELP!!

Posted on 1999-07-15
10
Medium Priority
?
1,969 Views
Last Modified: 2008-02-26
I have a user that is doubting my system because of stupid runtime error 2467 (refers to object that does not exist) The error happens every second time certain forms are started.

I have code in the "On Current" event of main forms that triggers certain events in subforms. These triggers are neccesary...like text box locks, label visible etc.

For some reason the code runs before the subform opens (only every second time) The user closes the error window and opens the form. I can trap the error to be ignored I suppose but I am worried that I can end up with corrupted data.

The ideal solution would be to insure the subs always open before the code runs...how is this possible?

Or do you have another "easy" solution to this annoying problem? To me the Access Design Team should have this as built in functionality, but what do I know? :o/

The bottom line is why every second time? Seems Access changes the way it launches forms each time they open. A bug perhaps?

I DO have service pack release 2 installed so that doesn't help.

HELP
arrrgh

ToddMac
0
Comment
Question by:ToddMac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 10

Expert Comment

by:brewdog
ID: 2000406
that goes against everything I've heard and experienced with form/subform combos. I have an app out there now that has six subforms -- and I do the same kind of enabling/disabling/moving focus etc on all of them on form current, with no problems. The subforms are *always* supposed to load before the main form. Are you closing the form in a normal fashion between the first and second times you open it?
0
 
LVL 1

Expert Comment

by:Ghis68
ID: 2000407
Whit out more information on the procedure.  The only thing I can suggest in the event on current where the error append try to add this.


Dim X as integer
For X = 1 to 50
   DoEvents
next

Just to give more time to Ms Access... to do ???
0
 
LVL 4

Expert Comment

by:threeps99
ID: 2000408
The full error message for that is:

You entered refers to an object that is closed or doesn't exist.@For example, you may have assigned a form to a Form object variable, closed the form, and then referred to the object variable.@@1@@1

Are you sure your not closing hiding the form and not closing it?
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 1

Expert Comment

by:jdesharnais
ID: 2000409
Are you running win NT?
I have had this happento me also. What I found is because NT is multitheaded  the subform was not quite loaded yet(i should be though) when you get to the "on current" event of the main form.

Ghis68 solution may work? I sound like it might.

What I do has add a timer interval of  200 (as long as it is a bit).  

Private Sub Form_Timer()
       Form_Current()
        TimerInterval = 0
end sub

0
 

Author Comment

by:ToddMac
ID: 2000410
To answer the NT question one machine is NT but the main user machine is running Win98. Personally I think that operating systems sucks and it is not as stable as Win95. As for the WinNT workstation...I think the designers at Microsoft were sniffing glue when they designed that piece of junk...but that is another story.

I will try the timer event and get back to you. I did add error handlers in spite of my earlier statement and they seem to be doing okay, but I have a nagging suspicion it will cause corruption someday.

As for the forms opening and closing in the usual way...yes that is the case. I have a command button that has the following in the OnClick event:

DoCmd.OpenForm "frmTicket"

I also have some created by wizard as follows:

On Error GoTo Err_cmdDelUSA_Click

Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmDelTickUSA"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
   
Exit_cmdDelUSA_Click:
    Exit Sub

Err_cmdDelUSA_Click:
    MsgBox err.Description
    Resume Exit_cmdDelUSA_Click

Doesn't matter which way I code it the same thing happens.

Brewdog I find it strange that I am getting these errors and you are not. Could the fact that I did some development on the NT machine be the cause?

On another matter what is the story with "Save Failed"? I get this every now and then when I do a save. It always work on the second try...

Hmmm second try...could there be a connection?

I think there is a bug in the software!

Also Brewdog, for your info I have not had a chance to get to the search function yet. Sorry man

ToddMac
0
 
LVL 10

Expert Comment

by:brewdog
ID: 2000411
no problem on the search function thing. I had forgotten about it. :o)  A few too many questions in the brain right now anyway.

My system with six subforms was designed entirely on an NT box, though it's running on a 95 machine with Novell network with no real problems, either. (I had to tweak a couple things, but nothing major.) I would be mighty frustrated if because of NT's "multi-threading" a subform wouldn't load before a main form.
0
 
LVL 1

Expert Comment

by:Ghis68
ID: 2000412
The Event On Open is trigger before the Event On Current
You can trap the error in this procedure and do a loop until you don't have the error
this should be save an your On current procedure will work perfectly

On error resume next

Me![subform].form![field].locked =true  'Something causing the error
Do Until Err = 0
    Err = 0
    debug.print Me![subform].form![field]
Loop
0
 
LVL 1

Expert Comment

by:jdesharnais
ID: 2000413
I forgot to tell you something.

set up a boolean variable
it the on current event add something like

if firstflag = true then
 subform stuff
else
 firstflag = true
end if

0
 

Author Comment

by:ToddMac
ID: 2000414
Folks thanks for all the help...I am having success with Ghis68' solution. Lock in your points man

Thanks

ToddMac
0
 
LVL 1

Accepted Solution

by:
Ghis68 earned 120 total points
ID: 2000415
The Event On Open is trigger before the Event On Current
       You can trap the error in this procedure and do a loop until you don't have the error
       this should be save an your On current procedure will work perfectly

       On error resume next

       Me![subform].form![field].locked =true  'Something causing the error
       Do Until Err = 0
           Err = 0
           debug.print Me![subform].form![field]
       Loop
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question