我记的是APP的一个属性可判断当前程序是否已执行。

解决方案 »

  1.   

    If App.PrevInstance Then
        MsgBox "此程序已经运行!", vbInformation
        End
    End If
      

  2.   


        注意慎用end语句强行结束应用程序。
      

  3.   

    If App.PrevInstance Then
        MsgBox "此程序已经运行!", vbInformation
        End
    End If
      

  4.   

    If App.PrevInstance = True Then   '限制程序在本机上多次运行
            MsgBox "程序已经在运行!", vbExclamation + vbOKCancel, "医院管理系统"
        Else
            frmconnection.Show
            'App.TaskVisible = False
        End If