Stop all VBA code running

  • Thread starter Thread starter Jim Franklin
  • Start date Start date
J

Jim Franklin

Hi,

Can anyone tell me if there is a way of terminating ALL vba code which is
running in an Access 2003 application?

I have an form which contains a Winsock control to communicate with a remote
device on the network. Periodically I am getting a Winsock Error "10054: the
connection is reset by server side." after which I cannot communicate with
the remote device. I am trying to get to the bottom of why this is
happeneing.

I can capture the error in the Error event of the winsock control, but there
are other threads which are running, such as form timer events, and the
procedure that tried to connect with the winsock in the 1st place. What I
would like to do is terminate all code running from my error event, reset
any variables etc. just as if I had clicked the Reset/Stop button in the vb
editor window.

Does anyone know if it is possible to do this?

Many thanks,
Jim
 
Jim Franklin said:
Hi,

Can anyone tell me if there is a way of terminating ALL vba code which is
running in an Access 2003 application?

I have an form which contains a Winsock control to communicate with a
remote device on the network. Periodically I am getting a Winsock Error
"10054: the connection is reset by server side." after which I cannot
communicate with the remote device. I am trying to get to the bottom of
why this is happeneing.

I can capture the error in the Error event of the winsock control, but
there are other threads which are running, such as form timer events, and
the procedure that tried to connect with the winsock in the 1st place.
What I would like to do is terminate all code running from my error event,
reset any variables etc. just as if I had clicked the Reset/Stop button in
the vb editor window.

Does anyone know if it is possible to do this?

Many thanks,
Jim

Seems a bit drastic, but yes it's doable. Just include the line:

End
 
Thanks Stuart. Sounds silly but i never realised you could do that!

It probably is drastic, but until I can find the reason for the Winsock
errors at least it will do for now.

Thanks again,
Jim
 
Back
Top