Functions Not Working

G

Guest

I've developed a ms access database at work which has many users and runs off
of several computers. The problem I'm having is the VB code functions such
as mid, ucase, lcase, <, >, format works fine on some computers and on others
these functions are not recognized.

Is there a way to call the library globally on when the form opens or in a
module so that I don't have to worry about having two different databases for
what I call good computers and crappy computers... if there is a way, how do
I implement it; please be specific?
 
G

Guest

Hello MisterMe,

I had the same problem. My Office installation files were in a different
location than where the staff had theirs. I found a piece of code that has
worked for me.
Sadly, I do not know who to credit it to ( I didn't write it).

Dim r As Reference, R1 As Reference
Dim s As String
' Look for the first reference in the database other
' than Access and Visual Basic for Applications.
For Each r In Application.References
If r.name <> "Access" And r.name <> "VBA" Then
Set R1 = r
Exit For
End If
Next
s = R1.FullPath
' Remove the Reference and add it back.
References.remove R1
References.AddFromFile s
' Call a hidden SysCmd to automatically compile and save all modules.
Call SysCmd(504, 16483)

Good luck with it.
 

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