这可能是一个简单的解决方案,但是我无法正常工作。可能只是语法。
基本上我想将它们合并在一起,以便弹出一个消息框而不是5。
If Me.Status_Mfg_Engineer <> "Approved" Then MsgBox "MFG Engineer has not approved"
If Me.Status_Quality <> "Approved" Then MsgBox "Quality has not approved"
If Me.Status_Production <> "Approved" Then MsgBox "Production has not approved"
If Me.Status_Product_Engineer <> "Approved" Then MsgBox "Product Engineer has not approved"
If Me.Status_Other <> "Approved" Then MsgBox "Other has not approved"
答案 0 :(得分:1)
您可以使用If.. ElseIf .. Else
If Me.Status_Mfg_Engineer <> "Approved" Then MsgBox "MFG Engineer has not approved"
ElseIf Me.Status_Quality <> "Approved" Then MsgBox "Quality has not approved"
ElseIf Me.Status_Production <> "Approved" Then MsgBox "Production has not approved"
ElseIf Me.Status_Product_Engineer <> "Approved" Then MsgBox "Product Engineer has not approved"
ElseIf Me.Status_Other <> "Approved" Then MsgBox "Other has not approved"
End If
编辑2: 是的(@ June7)-根据文档here
答案 1 :(得分:1)
如果要测试所有项目,然后发出单个复合消息,请考虑:
Dim strMsg As String
If Me.Status_Mfg_Engineer <> "Approved" Then strMsg = "MFG Engineer" & vbCrLf
If Me.Status_Quality <> "Approved" Then strMsg = strMsg & "Quality" & vbCrLf
If Me.Status_Production <> "Approved" Then strMsg = strMsg & "Production" & vbCrLf
If Me.Status_Product_Engineer <> "Approved" Then strMsg = strMsg & "Product Engineer" & vbCrLf
If Me.Status_Other <> "Approved" Then strMsg = strMsg & "Other" & vbCrLf
If strMsg <> "" Then MsgBox "Items not approved: " & vbCrLf & strMsg
答案 2 :(得分:1)
您需要一个消息框,其中总结了哪些代理商尚未批准。
Accept-Encoding: gzip, deflate