I have a form with certain fields that must run a different macro depending on what fields are selected.
What I have below is working fine but I not completely accomplishing what is required. I would like the 2nd Macro to be dependent upon two fields being selected. I want the McrApprovedButz to run only if the Status field = Approved and the Manager Approval Name = James Butz. Could you please let me know what to adjust in my second example. There are actually 5 different managers and I want a different macro to run based on what Manager Approval Name is selected. Is this possble?
Example 1 - Works fine
Code:
Private Sub CboStatus_AfterUpdate()
If [Status].Value = "Completed" Then
DoCmd.RunMacro "McrCompletedItem"
ElseIf [Status].Value = "Approved" Then
DoCmd.RunMacro "McrApprovedButz"
End If
End Sub
Example 2 -
Code:
Private Sub CboStatus_AfterUpdate()
If [Status].Value = "Completed" Then
DoCmd.RunMacro "McrCompletedItem"
ElseIf [Status].Value = "Approved" and
[ManagerApprovalName].Value = "JamesButz" Then
DoCmd.RunMacro "McrApprovedButz"
End If
End Sub