MDE Library

G

Gary D.

Can somebody please help with a MDE file reference problem?

I have two Access97 databases/applications.

Each of these has a single standard module and each contains one
public function, declared in the same manner.

Both database have been converted into MDE files and are used as
library databases.

DB1 is called "Data Encryption" (Tools…Options…Advanced…Project Name).
The module is call "XED"'.
The function is "SecureData"'.

DB2 is called "Utilslib".
The module is call "UTILS"'.
The function is "Duration"' (I've checked and Duration is not a
reserved word).

These are used thus:-

DB1 is called by another database (DB3) and within a form a call is
made thus:-
Me!txtAccountTag = SecureData("D", _
lngKey, _
Me!AccountTag.Value)
The form module has the reference declared via Tools… References
This call works just fine.

DB2 is called by another database (DB4) and within a form a call is
made thus:-
Me!Drn = Duration(Nz(Me!TimeS.Value, "00:00:00"), _
Nz(Me!TimeE.Value, "00:00:00"))
The form module has the reference declared via Tools… References

However, the call in DB4 fails with error code 13, "Type mismatch".
I have tried defining the Duration function with its parameters as
both ByVal and ByRef, without any difference.

If I prefix the word "Duration" with "GJDUtilsLib." to give
"GJDUtilsLib.Duration" then the call works okay.

Why?


PS. the only difference between the two library databases is that DB1
is owned by a different user/owner than DB2, but that doesn't explain
why prefixing it with "GJDUtilsLib." Works when it fails without the
prefix.
 
R

Rick B

One post please. You don't need folks from different groups working on your
issues if someone already posted an answer in another group.
 
P

Paul Overway

The type mismatch and need to preface the function with GJDUtilsLib.
suggests you have a function called Duration declared in more than one
place/library...and the other function requires a different data type for
its parameters.
 
G

Gary D.

Yes, I've done that and no other Duration was found.
I've also changed different datatypes for the function arguments and
the returned values, no difference.

It's probably something blindingly obvious that I'm missing.
Will keep investigating.
 
G

Gary D.

Phew!

That was one of the strangest problems I've encountered.

Apparently it was caused by the form containing a control (that I had
previously deleted) with the same name as the external library
function, even though the form's control wasn't showing up anywhere on
the form (i.e. it was mysteriously hidden after having been deleted).
It was still being identified as being somehow present and that's why
Access couldn't resolve the function name due to duplicate names.

I had to recreate the form as new from scratch, and now it works okay.

I didn't realise that form objects could have hidden deleted controls.
Weird!
 

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