Convidad 16/12/2011, 09:06
duvido que funcione desse jeito, com erros
Function IsLoad(strFormName As String) As Boolean
Const conDiseg = 0
Dim entX As Integer
IsLoad = False
For entX = 0 To Forms.Count - 1
If Forms(entX).Formname = strFormName Then
If Forms(entX).CurrentView <> conDiseg Then
IsLoad = True
Exit Function
End If
End If
Next
End Function
No Formulário 3, por exemplo:
Private Sub Form_Close()
If IsLoad("Form01") = False and Isload ("Form02") = False and Isload ("Form04") and = False then
Application.Quit acQuitSaveAll
End If
End Sub
corrigido;
Function IsLoad(strFormName As String) As Boolean
Const conDiseg = 0
Dim entX As Integer
IsLoad = False
For entX = 0 To Forms.Count - 1
If Forms(entX).Form.name = strFormName Then
If Forms(entX).CurrentView <> conDiseg Then
IsLoad = True
Exit Function
End If
End If
Next
End Function
No Formulário 3, por exemplo:
Private Sub Form_Close()
If IsLoad("Form01") = False and Isload ("Form02") = False and Isload ("Form04") = False then
Application.Quit acQuitSaveAll
End If
End Sub