Error 5 is one of the least-intuitive errors that VB throws.
Case "Field"
'get parent(fields).parent(profile).name
Set mProfile = KI.Profiles(Node.Parent.Parent.Text)
Set mField = mProfile.Fields(Node.Text)
Consider the above code. The last line throws the error sometimes. The value of Node.Text is valid, with the value being one of the keys in the Fields collection. The Fields collection exists, the mProfile object exists. Yet that line throws error 5 in rare circumstances.
Wish I knew why. Anyone here really understand VB error 5?
In any and all cases, can you guarantee that all of your objects or values are absolutely valid throughout the entire procedure?
Have you been able to reproduce in the debugger? What about getting a dump file? :P
Quote from: Adron on October 25, 2004, 12:21 PM
Have you been able to reproduce in the debugger? What about getting a dump file? :P
Ah, yes, the AdronVBErrorDump DLL .... I should find that again.
Quote from: Grok on October 25, 2004, 02:22 PM
Quote from: Adron on October 25, 2004, 12:21 PM
Have you been able to reproduce in the debugger? What about getting a dump file? :P
Ah, yes, the AdronVBErrorDump DLL .... I should find that again.
Out of curiousity, do you have a conditional Dim? That is, is mField being declared sometimes and sometimes not, depending on your code path?
Quote from: MyndFyre on October 25, 2004, 02:23 PM
Quote from: Grok on October 25, 2004, 02:22 PM
Quote from: Adron on October 25, 2004, 12:21 PM
Have you been able to reproduce in the debugger? What about getting a dump file? :P
Ah, yes, the AdronVBErrorDump DLL .... I should find that again.
Out of curiousity, do you have a conditional Dim? That is, is mField being declared sometimes and sometimes not, depending on your code path?
No conditional Dim. Didn't know I could anyway. Plus, at the point of error when I let the program break, it is on that line and the values of everything are defined. The count is correct and the key I am looking for is in the collection. Item is the default property of the collection. The class is solid afaik, getting 10,000+ calls per day by about 5 different processes.
Quote from: Grok on October 25, 2004, 02:45 PM
No conditional Dim. Didn't know I could anyway. Plus, at the point of error when I let the program break, it is on that line and the values of everything are defined. The count is correct and the key I am looking for is in the collection. Item is the default property of the collection. The class is solid afaik, getting 10,000+ calls per day by about 5 different processes.
But you've got it in the debugger? If you have, shouldn't it be easy to figure just by picking out one piece of the statement at a time and evaluating that?