Function MS Access can't find

  • Thread starter Thread starter Terry
  • Start date Start date
T

Terry

Dear All,

I have a macro that imports a few text files. I check for
the existence of the text files with a Dir function.

Now whenever I call the dir function I get "The expression
you entered has a function name that Microsoft Access
can't find." I have checked all the references and they
appear to be all right (the same as a working PC's).

Any one .... any suggestions?

Access 2002 sp3
Windows 2k sp4

Thanks in advance for any ideas.


Terry
 
Sometimes even if the references look okay, there can still be a problem
with them. Here are the instructions I normally post:

On the machine(s) where it's not working, open any code module (or open the
Debug Window, using Ctrl-G, provided you haven't selected the "keep debug
window on top" option). 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)
 
Douglas,

Thanks for your response. I have tried all of the ideas
you suggested.
I can not deselect the VBA or the Access 10 object
libraries.

Anything further that can be attempted? I would rather not
fdisk and fully re-install ...... but if I have to ...


Thanks again,

Terry
 
Try creating a new database and importing all of the objects from your old
database.
 
Douglas,

Been there and done an import to a new db.

A new blank data-base with only an unbound form with 1
control on it containing "dir("")" gives the same result.
The function formats with a capital D in the dir but will
not find the function when executing.

Do you know what reference would contain the dir function
or how I would go about finding out? The VBE6.dll and the
msacc.olb files on my pc are the same size and version as
on a pc that works?

I'll become bald soon if I keep pulling my hair out at
this rate.

Thanks again for your interest,

Terry
 
If you go to the Object Browser (F2 when you in the VB Editor or have the
Debug window open), you'll see that Dir is in the VBA library.
 
Back
Top