Private Sub 关闭_Click()
Dim Err1 As Boolean
Dim Err2 As Boolean
If 状态一 = True Then
状态 = 1
ElseIf A状态二 = True Then
If B状态二 = True Then
状态 = 2
Else
Err1 = True
End If
ElseIf A状态三 = True Then
If B状态三 = True Then
状态 = 3
Else
Err1 = True
End If
ElseIf A状态四 = True Then
If B状态四 = True Then
状态 = 4
Else
Err1 = True
End If
ElseIf A状态五 = True Then
If B状态五 = True Then
状态 = 5
Else
Err1 = True
End If
Else
Err2 = True
MsgBox "错误2"
End If
If Err1 = True Then
MsgBox "错误1"
Exit Sub
End If
If Err1 = False And Err2 = False Then
MsgBox "该流程目前处于状态" & 状态
DoCmd.Close
End If
End Sub
Function 状态一() As Boolean
状态一 = (Nz(日期1) <> "" And Nz(日期2) = "" And Nz(日期3) = "" And Nz(日期4) = "" And Nz(日期5) = "")
End Function
Function A状态二() As Boolean
A状态二 = Nz(日期1) <> "" And Nz(日期2) <> "" And Nz(日期3) = "" And Nz(日期4) = "" And Nz(日期5) = ""
End Function
Function A状态三() As Boolean
A状态三 = Nz(日期1) <> "" And Nz(日期2) <> "" And Nz(日期3) <> "" And Nz(日期4) = "" And Nz(日期5) = ""
End Function
Function A状态四() As Boolean
A状态四 = Nz(日期1) <> "" And Nz(日期2) <> "" And Nz(日期3) <> "" And Nz(日期4) <> "" And Nz(日期5) = ""
End Function
Function A状态五() As Boolean
A状态五 = Nz(日期1) <> "" And Nz(日期2) <> "" And Nz(日期3) <> "" And Nz(日期4) <> "" And Nz(日期5) <> ""
End Function
Function B状态二() As Boolean
B状态二 = (A状态二 = True And 日期1 <= 日期2)
End Function
Function B状态三() As Boolean
B状态三 = (A状态三 = True And 日期1 <= 日期2 <= 日期3)
End Function
Function B状态四() As Boolean
B状态四 = (A状态四 = True And 日期1 <= 日期2 <= 日期3 <= 日期4)
End Function
Function B状态五() As Boolean
B状态五 = (A状态五 = True And 日期1 <= 日期2 <= 日期3 <= 日期4 <= 日期5)
End Function
有点看不懂
Dim Err1 As Boolean 是什么意思?
以下这段又是怎么解释?
Function 状态一() As Boolean
状态一 = (Nz(日期1) <> "" And Nz(日期2) = "" And Nz(日期3) = "" And Nz(日期4) = "" And Nz(日期5) = "")
End Function