Me.Name results in "Invalid procedure call or argument"

C

comcraft1966

I am debugging an Access application written by someone else. In
Access 2003 it behaves OK, but the client needs to upgrade to Access
2007 for various reasons. When the app is run in Access 2007 I get a
few niggles that I have been working through, but this one has really
got me stumped....

A subform of a subform (I'll call it subform2) will not display any
records. On further investigation I noticed the following line of code
was producing the following error

Me.RecordSource = strSQL
Results in Error 2467 The expression you entered refers to an object
that is closed or doesn't exist.

This line of code runs from the Oncurrent event of subform2. In the
same event whilst debugging I noticed the following:

Me.Name
Results in Error 5 Invalid procedure call or argument

That's the one that really got me!

What I have done so far (The problem could be reproduced after each
change listed below):
Converted the mdb to an accdb file
Imported all objects in to a new accdb file
Decompiled/recompiled (a thousand times)
Tried SaveAsText on all forms
Matched all references in the accdb to those in the original mdb .
This included adding the "microsoft forms 2.0 object library" and
"Microsoft windows common controls" back in, even though the accdb did
not require them to compile.

I'm stuck help!

Paul
 
B

Brendan Reynolds

This line of code runs from the Oncurrent event of subform2. In the
same event whilst debugging I noticed the following:

Me.Name
Results in Error 5 Invalid procedure call or argument

Just Me.Name on it's own, or is it something = Me.Name, or Me.Name =
something?

Is there a field in the form's recordsource, a control on the form, or a
procedure, called Name? That could well cause a problem, as Name is a
reserved word and should not be used as an identifier.
 
C

comcraft1966

Just Me.Name on it's own, or is it something = Me.Name, or Me.Name =
something?

Is there a field in the form's recordsource, a control on the form, or a
procedure, called Name? That could well cause a problem, as Name is a
reserved word and should not be used as an identifier.

Just "debug.print Me.Name". There are no reserved words used anywhere.

Paul
 
C

Clifford Bass

Hi Paul,

Is it really "debug.print", all lower case? Then the error is probably
in finding "Debug.Print". Any "debug" objects defined anywhere? Or, there
is a possibility that there is some non-printing character mixed into that
line. Probably none of your efforts would get rid of it. How about deleting
the entire line and retyping it? Of course, you could just get rid of the
line altogether.

Clifford Bass
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top