Opening And Closing A Notepad (.txt) File

  • Thread starter Thread starter Arturo
  • Start date Start date
A

Arturo

I am running some code that opens up scripts on screen. They take about 45 to
60 seconds to run. At the end of the process, Access closes. I would like to
insert some code at the beginning of the process that will open the file
"C:\Folder\PleaseWait.txt" and maximize it so it covers the entire screen.
Then, at the end of the process I would like it to close.

The process would be like this:

Open "C:\Folder\PleaseWait.txt.â€
Run my code.
Close "C:\Folder\PleaseWait.txt.â€

Thank you.
 
There's a number of different ways to go about notifying a user of a
process... MsgBoxes within Access, progress bars, etc. Opening a File and
Closing it after is possible, but comes with some dangers.

You need to use an API and pass the handle of the open file to the API in
order to close it again, but what if someone closes it by the "x" button
because they don't want to look at it? API's are often rather complex, I'm
not sure how to go about validating the handle is available (or getting the
opened files Handle to begin with), let alone verifying that the user hasn't
closed it.


I think you might be a lot better off googling some Progress Bars for
access... use them in your load procedure of the app and turn it off in the
unload of your app. This will also give you control over whether or not the
progress bar form can be closed by the user, which you cannot do (that I know
of) with an external file.


--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Or maybe a form in Access that says "Please Wait". You would have control
over it.


But, like Jack says, a progress bar would be best.

(my 2 cents)
 
Back
Top