Accessforce quitting an automated word application

  • Thread starter Thread starter Aaron
  • Start date Start date
A

Aaron

Hello,

I have made a form which has the ability to make an automated word document.
I want to be able to force quit the writing to the word document if the user
chooses since it takes a minute or two to write to the larger documents. The
automation consists of loops which write to the first row in a table, and
then copy the row. The code then pastes another row below the current row and
updates the fields in the pasted row. This is done over and over again until
the word report is complete.

I have already put this question up on the forum to solve this and it has
been suggested to put code in the beginning of the copy/paste loop that quits
the subroutine in the loop when the user decides to force quit. The user
would be able to force quit by placing a button on the respective form that
would tell the loop to quit the subroutine.This method would definitely work
but after trying it out I have found another issue.

The problem is that the user can't press the button on the form because
Access will not respond while the word document is being written too. What
happens is that the form comes up and the arrow pointer turns to the
hourglass and I can't do anything at all with Access. I can't even minimize
the window or close it using the X at top right of the window in the title
bar. However, I can access the taskbar and any other program.

I was just wondering if there is some kind of setting or anything that would
allow me to access the form. Maybe this is not possible because Access is
just busy? Any help is greatly appreciated. I am using MS Acess 2003 with SP3.

Thank You for your time and help in advance,
Aaron
 
just put a doevents command in the looping code...it will allow ms-access to
process keypress and clicks....
 
I'm pretty sure that there was a DoEvents command in the suggested
code I sent in response to your request or another identical to it.
:-)

HT
 
Just scrolled down and, Yup. there's a DoEvents command shown.

Also, you must break up the Word elements so that you are only sending
a part of the Word massage on each iteration of the loop. If you send
out all the Word content as a single element then the loop wouldn't be
effective.

HTH
 
Yes Larry you are right, but I wasn't exactly sure what the DoEvents command
was for exactly and believe it or not I wasn't 100% sure what it did based
off the description on MSDN and other forums. That is why there was a bit of
confusion on my part and the reason I reposted a similar question. I think I
got a handle on it now though:)

Thanks for all your help and the suggestions, it helped a lot and everything
is working smoothly now:)

Aaron
 
Back
Top