We help IT Professionals succeed at work.

Undefined Function Mid

robertjbarker
on
Medium Priority
1,324 Views
Last Modified: 2007-12-19
I am trying to use the Mid worksheet function. I can get it to work on my laptop (which I set up) but when I try to use it on the company desktop, I get "Undefined function 'Mid' in expression". Same results with Mid$.

Anybody have any ideas? Other than calling the help desk to fix my installation of Access...
Comment
Watch Question

Commented:
Hi robertjbarker,
Open VBA, and select Tools -> References. Are any marked as missing or broken?
Dave :-)

Commented:
Code with errors can do strange things to Access functions.  Ctl-G or Alt-F11 to get to VB Editor.  Click Debug and Compile.  Comment out or Delete any highlighted code.  Then go to the Immediate Pane and type:

? Mid("GRayL",2,3)
Ray '<--this is what you should get.

Before that, you may want to click on Tools, References, and check for any 'Missing' items.

Author

Commented:
There are a large number of items left unchecked. One of the checked items is noted as missing:
"MISSING: Microsoft DAO 2.5/3.5 Compatibility Library"
Commented:
There you go.  Not even sure what that's used for.

Untick it, and compile your code, does it error anywhere during the compile?
If not, the Mid should work
Dave

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
? Mid("GRayL",2,3)

is changed to

Print Mid("GRayL",2,3)

And the error comes up "Compile error: Invalid outside procedure"
Most Valuable Expert 2014

Commented:
Dave,

That was from one of the earlier JET/MDACs. It's hanging around from Office95 IIRC.

Author

Commented:
That's about the dumbest thing I can think of. Something is missing, untick it (meaning ignore it?), and then things can be found.

But that worked, and thanks.

I like SQL Server.

Commented:
Yeah.. I don't really get it either.. Common problem though, glad it's all sorted :P
Dave

Commented:
> That was from one of the earlier JET/MDACs. It's hanging around from
> Office95 IIRC.
Well before my time :P
Dave
Most Valuable Expert 2014

Commented:
You'll want to untick it on your laptop as well.  Cause if you copy it to your WS again it will have the same problem.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.