John, there is something wrong here.
You said you are on Access 2000, but you are using the Access 10 object
library? Access 2000 should use the Access 9 library. If this is really
the
case, you need to create a new (blank) database, turn off the Name
AutoCorrect setting (uncheck the boxes under Tools | Options | General),
and
then import everything from the bad database.
If you are actually using Access 2002, then the Acc 10 library is
correct.
You may need to get your IT people in to change the registry setting for
you. They should be able to do it based on that article.
Or you might be able to work around the issue by creating your own
wrapper
function for Dir in a standard module, e.g.:
Function Dir2(PathName As String) As String
Dir2 = Dir(PathName)
End Function
and then use Dir2() in your query.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
Thanks to you both. I've checked the references - none are "missing"
and
the
following are checked:
Visual Basic For Aplications
Microsoft Access 10.0 Object Library
Microsoft DAO 3.6 Object Library
I was advised to set my mdb to this through this newsgroup, when I was
having problems with some code a few months ago. Should I be adding
some
other library?
As for the registry, I'm afraid I know enough not to go poking around
in
this, even if I could. This is a networked setup and I probably
couldn't
modify the registry if I wanted to.
How do I proceed? Thanks, JohnB
:
I'm wondering if it could also be the Sandbox mode, Allen.
http://support.microsoft.com/?id=239482 doesn't list Dir in the list
of
functions in Jet queries when Sandbox mode is enabled, and states that
"Any
functions that do not appear in the list are not available in Sandbox
mode."
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
References problem.
Details:
http://allenbrowne.com/ser-38.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
I have a query which selects a field containing the path and image
name
for
an image. The field is called ImagePathAndFile and typically
contains
C:\My
Pictures\Mvc0000.JPG.
I posted a question as to how to produce a field containing just
the
image
name and was told to use Dir([ImagePathAndFile]) in a spare field
in
the
query. This works fine on my Access97 machine at home but produces
an
Error
here in work, using Access 2000 on XP: "Undefined Function 'Dir'
in
Expression".
Any idea why this is happening? Thanks, JohnB