Acc2002: form code doesn't see code in other modules

A

A man

I have Win2000, Access 2002, using a file in A2000 mode. I have a form, called
Util with code in it. I have a module in the same MDB file, called "Utility".
In other versions of access all code had access to all code in other modules,
like Utility. Now, my code in the form Util does not see any routines in the
Utility module. Even if my subs and functions are Public.

Example.
I have one function declared as:
public function CurrentDBDir() as string
....

Another sub as:
Public Sub writeln(s as string)
....

So why can't my form Util see the routines CurrentDBDir or writeln? I get
compile errors, like "ambiguous name detected: writeln".
 
6

'69 Camaro

You'll find that other code won't run properly when you have compile errors
in a module, such as your "ambiguous name of writeln" error. First, remove
or rename the extra copies of the writeln procedure, then fix all other
compile errors. Then see whether your code runs properly.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
D

Dirk Goldgar

A man said:
I have Win2000, Access 2002, using a file in A2000 mode. I have a
form, called Util with code in it. I have a module in the same MDB
file, called "Utility". In other versions of access all code had
access to all code in other modules, like Utility. Now, my code in
the form Util does not see any routines in the Utility module. Even
if my subs and functions are Public.

Example.
I have one function declared as:
public function CurrentDBDir() as string
...

Another sub as:
Public Sub writeln(s as string)
...

So why can't my form Util see the routines CurrentDBDir or writeln? I
get compile errors, like "ambiguous name detected: writeln".

That message is telling you that there are two (or more) public
procedures named "writeln", so it doesn't know which one you mean. It's
not that the routine can't be seen, it's that Access can see too many of
it! Check to make sure you don't have two copies of your Utility
module, or that you don't have these routines defined in multiple
modules.
 
A

A man

That message is telling you that there are two (or more) public
procedures named "writeln", so it doesn't know which one you mean. It's
not that the routine can't be seen, it's that Access can see too many of
it! Check to make sure you don't have two copies of your Utility
module, or that you don't have these routines defined in multiple
modules.

You were right. I had an old copy of this module in the database file.
 

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