transfertxt file busy

T

Trever B

I need to add to following code a wait statement while file is busy.
I am running an external program through access which writes to file.

After written I do following:-

DoCmd.TransferText acImportDelim, "", "tbl Directory Info temp1",
"e:\FIRINFO.txt", False, ""

how do I put a wait file is currently busy statement in.

Thanks for help
 
B

Brian

Two issues here: how to make Access wait and how to display the message. On
the former, Access simply does not wait while the external program completes,
so you have to get a little creating.

Here is what I would do. Create a little modal form with the message on it
but no close button.

When the user clicks the button to run the process:

1. Create a temporary file that gets deleted by the external process is done
with its text editing, etc.
2. Open the message form.
3. In the message form, set the Form_Timer to perhaps 1/4 second and check
for the existence of the temporary file. When it is gone, you will know the
external program has finished its process.
 
J

John Nurick

Trever,

If you're using the VBA Shell() function to run the external program,
use ShellAndWait() instead. This isn't a built-in function but there are
many versions of it on the Internet, including, I'm pretty sure, one at
www.mvps.org/access.
 
Top