[AccessD] (A97) Prevent multiple instances of Access

Bob Gajewski bob at renaissancesiding.com
Thu Mar 13 13:19:00 CST 2003


William

Okay - I didn't have the "(True)" parameter. The code works perfectly now. I did make a modification to bypass giving the user an option:

******************************************************
' Original Code
'  If fConfirm Then
'    If MsgBox(sMyCaption & " is already open@" _
'      & "Do you want to open a second instance of this database?@", _
'      vbYesNo Or vbQuestion Or vbDefaultButton2) = vbYes Then Exit Function
'  End If
  
' Modified Code - The user will not be given a choice!
  If fConfirm Then
    If MsgBox("The National Jobs database is already open.", _
      vbOKOnly + vbExclamation) = vbYes Then Exit Function
  End If
******************************************************

Thanks so much!

Bob


On Thursday, March 13, 2003 12:53 PM, William Hindman [SMTP:wdhindman at bellsouth.net] wrote:
> Bob
> 
> ....just put "RunCode" in a macro Action line and "winCheckMultipleInstances
> (True)" in the Function Name line ...without the quotes of course ...HTH :)
> 
> William Hindman
> "All it takes for evil to prevail is for good men to do nothing." Edmund
> Burke
> 
> 
> ----- Original Message -----
> From: "Bob Gajewski" <bob at renaissancesiding.com>
> To: <accessd at databaseadvisors.com>
> Sent: Thursday, March 13, 2003 11:17 AM
> Subject: RE: [AccessD] (A97) Prevent multiple instances of Access
> 
> 
> > William:
> >
> > Thanks for the reply! I understand that this is a module called
> > "mdlCheckMultipleInstances", but I do not know how to call this directly
> > from the autoexec. Could you help me just a little more here? I hate to
> > impose, but I truly appreciate the assistance!!
> >
> > Thanks,
> > Bob
> >
> > On Thursday, March 13, 2003 10:27 AM, William Hindman
> > [SMTP:wdhindman at bellsouth.net] wrote:
> > > Bob
> > >
> > > ....I use the following code module that was passed to me on this list
> > long
> > > ago ...I call it in an autoexec ...it works for me regardless of the
> > app's
> > > windowed state ...either giving the user a msgbox if the second app is
> > > visible or restoring the first it if its minimized and then closing
> > ...HTH
> > > :)
> > >
> >
> >
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> 
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 
> 




More information about the AccessD mailing list