I need to combine these two procedures and not sure how. User will Validate amounts but also need to have "rights" to approve which the criteria is in the Sub Can Approve.
Where and how do I use the CanApprove in the Validate sub???
Sub Validate()
If Val(Me.Projected & "") + Val(Me.Projected & "") = 0 Then
MsgBox "Forecast Must Be Entered"
Else
If Val(Me.Projected & "") + Val(Me.Projected & "") < 30000 Then
MsgBox "Approved"
Else
MsgBox "Amounts Cannot Be Approved"
End If
End If
End If
End Sub
Function CanApprove(strManagerType As String, TotalCost As Long) As Boolean
Dim ApprovalLimit As Long
Select Case strManagerType
Case "SM"
ApprovalLimit = 300000
Case "Dir"
ApprovalLimit = 1500000
Case "VP"
ApprovalLimit = 3000000
Case "EVP"
CanApprove = True
Exit Function
End Select
CanApprove = (TotalCost < ApprovalLimit)
End Function
Where and how do I use the CanApprove in the Validate sub???
Sub Validate()
If Val(Me.Projected & "") + Val(Me.Projected & "") = 0 Then
MsgBox "Forecast Must Be Entered"
Else
If Val(Me.Projected & "") + Val(Me.Projected & "") < 30000 Then
MsgBox "Approved"
Else
MsgBox "Amounts Cannot Be Approved"
End If
End If
End If
End Sub
Function CanApprove(strManagerType As String, TotalCost As Long) As Boolean
Dim ApprovalLimit As Long
Select Case strManagerType
Case "SM"
ApprovalLimit = 300000
Case "Dir"
ApprovalLimit = 1500000
Case "VP"
ApprovalLimit = 3000000
Case "EVP"
CanApprove = True
Exit Function
End Select
CanApprove = (TotalCost < ApprovalLimit)
End Function