Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Dir function in Access 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ZX10@spamthis.com - 25 Jun 2006 12:37 GMT
I am converting a database from Access 97 to 2003, and cannot get the
DIR function to work.
Even creating a new database, with a single form, and one text box
=dir("C:\autoexec.bat")
doesn't work.

In all cases I get   #Name?   error.

What am I doing wrong?
Is this function disabled some where?
(Have checked security on help page - nothing disabled)

Help please.
Douglas J. Steele - 25 Jun 2006 15:14 GMT
It's possible that your References collection has been corrupted.

References problems can be caused by differences in either the location or
file version of certain files between the machine where the application was
developed, and where it's being run (or the file missing completely from the
target machine). Such differences are common when new software is installed.

Open the VB Editor (Alt F11). 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)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

>I am converting a database from Access 97 to 2003, and cannot get the
> DIR function to work.
[quoted text clipped - 9 lines]
>
> Help please.
zx10@spamthis.com - 26 Jun 2006 11:25 GMT
Thanks for the response.
Unfortunately it made no difference.
I cannot unselect:
  Visual basic for applications
  Microsoft access 11.0 object library
All other removed, then selected.
I will note that there are a lot of "visual basic for applications"
listings - seven more with the same name.
Active one is shown with location
  C:\program files\common files\microsoft shared\VBA\VBA6\VB....
cannot see past that - dialog box window doesn't allow resizing.

Any other suggestions?

>It's possible that your References collection has been corrupted.
>
[quoted text clipped - 18 lines]
>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 J Steele - 26 Jun 2006 13:07 GMT
What happens when you try to use the Dir function in the Immediate window
(Ctrl-G)?

Type:

?Dir("C:\autoexec.bat")

and hit Enter. What's returned?

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Thanks for the response.
> Unfortunately it made no difference.
[quoted text clipped - 32 lines]
> >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)
ZX10@spamthis.com - 27 Jun 2006 11:55 GMT
Now that's interesting.  It works!  (I didn't know you could do that)
It returns      autoexec.bat
Any clues why it would work here and not in a textbox on a form?

Thanks

>What happens when you try to use the Dir function in the Immediate window
>(Ctrl-G)?
[quoted text clipped - 4 lines]
>
>and hit Enter. What's returned?
Douglas J Steele - 27 Jun 2006 12:41 GMT
No idea at all. I don't have Access 2003 handy at the moment, but I have no
problem repeating your test form in Access 97.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Now that's interesting.  It works!  (I didn't know you could do that)
> It returns      autoexec.bat
[quoted text clipped - 10 lines]
> >
> >and hit Enter. What's returned?
david@epsomdotcomdotau - 23 Jul 2006 07:16 GMT
FWIW, to see the rest, go to the immediate window and type
application.references(1).FullPath
while you are there, you can also try .isbroken

Is it only the DIR function? If it's not a broken reference,
do you have something else named 'dir'?

7 installed copies of VBA is rather a lot, even if you have
Office 97, 2000, 2002, 2003 and 2007 installed. See if
you can find and remove any of them.

(david)

> Thanks for the response.
> Unfortunately it made no difference.
[quoted text clipped - 32 lines]
> >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)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.