By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,687 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

How to make procedure non-reentrant?

P: n/a
Is there a best-practice way to prevent a secondary call to a VBA procedure if
it is running? There must be some way to set a boolean flag or something. The
problem is with a third-party dialer program - double-click on a phone number in
a datasheet to dial the number. If it's launched while it's running the modem
gets all buttered up requiring a reboot to correct.

Dim strDial As String
Dim strDialer As String
strDialer = "C:\Program Files\Dial Engine Pro\dial.exe /"
strDial = strDialer & Forms!frm0!frm0Telephone!TelNumber
Call Shell(strDial)

suggestions welcome... thanks!
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

On Fri, 20 Feb 2004 08:55:36 GMT, deko wrote:
Is there a best-practice way to prevent a secondary call to a VBA procedure if
it is running? There must be some way to set a boolean flag or something. The
problem is with a third-party dialer program - double-click on a phone number in
a datasheet to dial the number. If it's launched while it's running the modem
gets all buttered up requiring a reboot to correct.


use a static variable, i.e.:

static fInHere as boolean
if finhere then exit sub
finhere=true
Dim strDial As String
Dim strDialer As String
strDialer = "C:\Program Files\Dial Engine Pro\dial.exe /"
strDial = strDialer & Forms!frm0!frm0Telephone!TelNumber
Call Shell(strDial)
finhere=false

Cheers,
Olaf [MVP]
--
My .02: www.Resources.IntuiDev.com
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.