Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to call functions in a database

Status
Not open for further replies.

GJP55

Technical User
Feb 2, 2003
220
GB

For some reason, my database will not compile. I get an error message that says Ambigouos Name detected when it gets to the first call of a procedure out side the module that I am initially in. This didn't happen yesterday ?

Any idea's ?

Thanks
 
Found reason was due to duplicate function names which had not been deleted.

Problem resolved.
 
When Access fails to detect a duplicate function name, it means the generated code is in bad shape.

One way to deal with this problem is to occasionally use the /decompile switch.

You can read about it on the internet; simply search for microsoft access decompile (or similar).

It also can make a significant reduction in size of your database.

One harmful side-effect I have noticed of decompile is that it may mess up type names with spaces.

For example, say you have a declaration such as
dim MyForm as [Forms_User Validation Form]

the decompile process sometimes removes the brackets. Simply put them back in.

Additionally, I have occasionally noted that decompiling changes a 'class' module into a regular module. Again, this is easily repaired by copying the code from the module into, say, the notepad, erasing the module, creating a new class module, and pasting the code back in.

However, the benefits of decompile (sometimes you are unable to access module code because the intermediate code has gotten fried) far outweigh the disadvantages, and I perform it frequently.

 
Beetee,

Thanks for that. I will read up on it first of all so I understand it a bit better.
Doesn't sound very encouraging for the code i have so far though !

Thanks

GJP
 
While I agree with Beetee on the /decompile switch, I'd like to re-give you some hope...your code might not be damaged (yet).
It's a duplicate declaration for sure. The reason may be that you created let's say a command button using the wizard, gave it a 'meaningful name', then deleted the button. After that you re-created it also through the wizard and gave it the same name. Access just duplicated the code without knowing it :)

Before deleting a control, make sure you first delete the code behind it...

Regards,

[pipe]
Daniel Vlas
Systems Consultant
 
Thanks Daniel,

What I actually did was copy one peice of code from a module and pasted into another (not deleting the initial one).

Been caught out with the button names before though.

Cheers

GJP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top