How to force import Window to start from access file (.mdb) root folder ?

  • Thread starter Thread starter Jürgen Germonpré
  • Start date Start date
J

Jürgen Germonpré

Hi,

Is there a way to force the Import brower window to start looking from the
access file root folder at all times ?
Perhaps by means of a registry setting ?

i.e.
I have a file: MyDatabase.mdb on K:\MyFiles\MyDatabases\Clients\
Each week I'm using the same database to import new files arriving in the
subdirectory \FilesToImport. So the full path is
K:\MyFiles\MyDatabases\Clients\FilesToImport.

Now I want to shortcut the browsing and get straight to the application root
folder.

Does anybody has a clue ?

Thanks a lot.

JG
 
Try changing the current directory:

ChDrive "K"
ChDir "K:\MyFiles\MyDatabases\Clients\FilesToImport"
 
Thanks.

Where should I put it then ?
This should be executed on startup... (somthing like this ChDrive
Application.CurrentProject.Path).

I just can't figure out to trigger this.

JG
 
Do you have a form that opens when your application opens? (A switchboard,
say)

If so, put the code in that form's Load event.

As long as Application.CurrentProject.Path points to a mapped drive, you
should be okay. If it points to a UNC, you can't do it.

Private Sub Form_Load()
Dim strPath As String

strPath = Application.CurrentProject.Path
If Mid(strPath, 2, 1) = ":" Then
ChDrive Left$(strPath, 1)
ChDir strPath
End If

End Sub
 
No, in fact the DB is used for importing, txt, excel files. Then it serves
as a base for some simple 'clean up' queries which on turn are used for
merging puposes. It's no application really.... It has some tables with a
standardised structure for that recurring job in particular. Plus, each
client/job has somewhat a different structure and thus needs it's own mdb as
it should also remain 'portable'.
There isn't a form or switchboard or whatsoever.

I could of course create a simple kind of autoexec routine, but then i have
to copy that particular 'master/template' .mdb for each new client/job and
each new database (via file->new or in windows, right button ....) would
lack it. What I really want that is fix it on 'application level'. For
instance in MS Excel I could easily add a routine in the personals.xls which
behaves as an autoexec.
I suppose it would be possible if I would program a add-in, but I'm not such
a experienced programmer...

JG
 
I'd create a function that executes the code I showed you earlier, and call
it from the AutoExec macro.

Yes, you'd have to import the module and the AutoExec macro into other
databases that needed that functionality, but other than that, I don't
believe there's any other way to accomplish what you want.
 
Oké
Anyway, thank you for your information.

Douglas J. Steele said:
I'd create a function that executes the code I showed you earlier, and
call it from the AutoExec macro.

Yes, you'd have to import the module and the AutoExec macro into other
databases that needed that functionality, but other than that, I don't
believe there's any other way to accomplish what you want.
 
Back
Top