How can I replace CurDir() with my own address?

seanlhall
seanlhall used Ask the Experts™
on
I have a form which loads a list of files from a local folder. The directory is CurDir(). If I change it to anything else I get errors. I have attached the database. LoadLocalDir.accdb
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I assume you are changing the line ..
  Me.txtLocalDir = CurDir()

to use something other than CurDir()

e.g.
  Me.txtLocalDir = "e:\myfolder"

So I think you would also need to change the line below , so that it includes your chosed folder.
 CTmp = Dir("*", vbDirectory)

To.. (i think)..
   CTmp = Dir (Me.txtLocalDir & "\*", vbDirectory)


I've only looked at the LoadLocalDir procedure.
You might have to do similar changes elsewhere.

Author

Commented:
I put in your suggestion and added db.Execute "delete from bzlocalDir" and it worked. Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial