How to open OS window from a form

  • Thread starter Thread starter Peter Hibbs
  • Start date Start date
P

Peter Hibbs

Access 2000, Win XP

I have a form with a Listbox control which shows a list of files in a
particular folder on the Server PC (via a network). I want to be able
to click a button on the form and open a window on the same folder so
that I can move, copy, delete, etc the files in the folder. The full
pathname to the selected folder is stored in a Text box on the form.

In other words, I want the button to simulate the operation of :-
minimizing the Access window, navigating to the folder on the Server
PC and opening a window on the same folder (which is what I have to do
at the moment if I want to change anything in the folder). To return
to the database I can just click on the Access button on the Task Bar.

What code would I need to do this (if it's even possible).

TIA

Peter Hibbs.
 
Arvin,

No, not quite what I wanted, I already have the pathname for the
required folder, what I want is to open a window on the folder as if I
had opened the folder in Windows XP.

Any other ideas?

Peter Hibbs.
 
Arvin,

OK, a bit more detail.

Imagine you are sitting in front of the computer and Access is
displaying a form on screen. One of the Text fields is displaying a
pathname to a folder, say "C:\My Documents\Access\Accounts\" for
example (actually it will normally be a path to a folder on a Server
PC).

Now I decide I want to delete one of the files in that folder so I
minimize Access (or click on the Show Desktop icon on the task bar
which does the same thing), I click the Windows Start button, then My
Computer, then double click C:\, then double click the My Documents
folder, then double click the Access folder, then double click the
Accounts folder which then shows me the contents of the Accounts
folder. Now I can delete the file (or whatever). With a Network system
it would be even more long winded. OK, the user can set up short cuts
to the 'root' folder to speedup the process a bit but there are
hundreds of subsidiary folders involved here.

The point is that I already know the pathname of the required folder
(it's stored in a Text box on the form) so I would like a button on
the same form which, when clicked, will, in effect perform all the
actions shown above, and open a window on the required folder.

I suppose another alternative (which may be acceptable to my client)
is to run Windows Explorer using the Shell command. Not sure how to do
that either as I would also need to pass the stored pathname to it
somehow.

Any ideas?

Peter Hibbs.
 
One last question. I understand that you know the path to the folder. Do you
know the filename as well? or will the user be required to just browse to
find it?
 
No, the user will want to select any file/s from the folder and then
move it, copy it, delete it, rename it, etc, etc. I had considered
giving them the option to just copy or delete a file with some VBA
code but they may also want to move multiple files from the folder in
question to another folder, create a new sub-folder, delete the old
folder and so on. Basically they need all the facilities of a standard
OS Window, all I need to do is give them quick access to the folder
that the database has currently selected so that they don't need to go
through the hassle of finding the relevant folder each time.

Apparently they do this quite a lot, the folders hold copies of
document files (mainly Word but could be PDF and XLS) which they have
created via the database and there is a sub-folder for each client
with sub-sub-folders for various categories of document such as
General Insurance, Motor Insurance, Life Insurance, Mortgage, etc,
etc.

Peter Hibbs.
 
Back
Top