Undefined Function "xxxx" in expression

B

Brian

Hello All,
I have developed an Access database in Access 2003 on Win XP (all service
packs).
The application runs fine on my PC.
When I run it on a different PC (same configuration) I get an error:
Undefined Function "Left" in expression
I have had other functions not working such as Date.
There are no missing references.
I have removed the references, closed the application and re-checked the
references.
I have checked the Sandbox mode and tried all combinations.
I'm stumped.

Thanks in advance,

Brian Clark
 
D

Douglas J Steele

Likely a problem with your References collection.

All Access databases contain references to external files that they use. If
the same versions of the files don't exist in the same locations on the two
machines, you can run into the problem you're encountering. The specific
function(s) causing problems isn't indicative of which reference is the
culprit, either. References are like apples: one bad one can spoil the whole
bunch.

On the machine(s) where it isn't working, open any code module, then select
Tools | References from the menu bar. Examine all of the selected
references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)
 
B

Brian

Thanks Douglas,
Just adding and removing a random Reference did the trick.
Now I have to deal with other reference problems.
The developers PC is set up differetly than the staff PC's and the
references are a problem.
I am using the SafeOutlook library and have it on a network drive that all
the staff use (same mapping for all) but it is not recognized. I will have to
explore this more.

All the best,

Brian Clark
 
B

Brian

I found that my Office (and Access) installation location was different on my
computer than the configuration used by the rest of my staff.

I was given this code piece to redo the Access Refrences for our production
database and it works.

'update the references test

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)
 
D

Douglas J. Steele

That makes no sense at all!

You can only refer to the reference's Name property and its FullPath
property if there's no problem with the reference. And if there's no problem
with the reference, there's no point in removing it from the References
collection and adding it back in.
 

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