Pause Code

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Suggestions on how to achieve the following would be
appreciated:

Using Access 2002 for a db for photo records.
On clicking a command button a new record is opened, the
user is asked if they want to rename/resize a photo
already downloaded onto the computer. If response is Yes,
Photoshop is opened.

Want we want to achieve is once Photoshop is opened to
suspend the Access code running until Photoshop is closed.

Thanks in advance

Tom
 
I recently read a different post on a similar topic. The suggested solution
was to utilize a modal form to make Access pause execution of the code.

You can place a command button on a modal form and launch PhotoShop using
this command button. Access will remain paused until the modal form is
closed. In the meantime, your user can run PhotoShop and return to the
modal Access form when done, close the form, and then resume running the
Access application.
 
Mike

I had already looked at that route and discounted it.

We are trying to minimize what the user has to do which
is why we are launching Photoshop programatically.

Tom
 
Hi, Tom.

Take look at the Windows API function, WaitForSingleObject( ), for launching
Photoshop and then waiting for it to complete before executing the next line
of VBA code in your database application. You can see an example on this
Web page:

http://www.mvps.org/access/api/api0004.htm

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
As an alternative for the WaitForSingleObject you can also poll the open
windows to see if you shelled process is still running.
The shell gives you a PID. From here you can check the hWnd against the PID.
While ever you can the window is open.
I give you the ability to close the modal form if things go badly.
There are probably a few other cat skinning techniques about as well.
See..
www.papwalker.com/public/waitforit.zip

peter walker
 
Back
Top