"mid" function error in Access 2007 runtime

D

Dhonan

I am running runtime access 2007 and get an error "mid" function undefined.
However, it works fine with the full version of Access 2007. Any ideas?
Thanks.
 
T

Tony Toews [MVP]

Dhonan said:
I am running runtime access 2007 and get an error "mid" function undefined.
However, it works fine with the full version of Access 2007. Any ideas?

Do you have any references besides the basic three? Are you sure you
need them? Write down the path and name of the extra ones (or put the
following code in a module and execute the code), delete from the
references list and Compile and Save All. Keep any necessary
references and ensure they are distributed to the target system.

Sub ViewReferenceDetails()

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " - " & ref.Major & "." & ref.Minor & "
- " & ref.FullPath
Next ref

End Sub

For a very detailed page on reference problems see
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html

Ctrl+G will take you into the Debug/Immediate window. Then click on
Tools on the menu bar and References.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
D

Dave C

The current Access 2007 runtime has a major bug. A call to just about any
native Access 2007 function as a direct part of a query causes an error, even
if the code works perfectly in the full version of Access 2007. Try creating
a local version of the function you're having a problem with, and reference
it in the query instead of the native function. This should resolve the
problem.

Public Function MyMid( byVal pcString as variant, ByVal pnStart as variant,
byVal pnLength as variant) as variant
MyMid = mid(pcString,pnStart,pnLength)
End Function
 
R

Rick Brandt

Dave said:
The current Access 2007 runtime has a major bug. A call to just
about any native Access 2007 function as a direct part of a query
causes an error, even if the code works perfectly in the full version
of Access 2007. Try creating a local version of the function you're
having a problem with, and reference it in the query instead of the
native function. This should resolve the problem.

Public Function MyMid( byVal pcString as variant, ByVal pnStart as
variant, byVal pnLength as variant) as variant
MyMid = mid(pcString,pnStart,pnLength)
End Function

Search these groups for "Broken Reference". Or "Reference Problem". What
you are seeing has nothing to do with the runtime.
 

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