Greetings,
I have two combo boxes AppStatus (with drop down NEW, REDETERM etc) & EligStatus (with drop down ELIG, DENIED etc) depending on what the user selects from each field, EligDays = the difference between two fields.
I'm new for programming. How do I get the result, (work days) not counting weekends, automatically to be filled in EligDays field?
Thanks,
DD
The following is the code i have please comment:
Private Sub AppStatus_AfterUpdate()
If [AppStatus].Value = "NEW" And [EligStatus].Value = "ELIG" Then
EligDays.Value = DateDiff("d", [AppRec], [EligDate])
ElseIf [AppStatus].Value = "NEW" And [EligStatus].Value = "DENIED" Then
EligDays.Value = DateDiff("d", [AppRec], [EligDate])
ElseIf [AppStatus].Value = "NEW" And [EligStatus].Value = "REACTIVATE" Then
EligDays.Value = DateDiff("d", [Reassess], [EligDate])
ElseIf [AppStatus].Value = "REDETERM" And [EligStatus].Value = "ELIG" Then
EligDays.Value = DateDiff("d", [RedetDue], [EligDate])
ElseIf [AppStatus].Value = "REDETERM" And [EligStatus].Value = "DENIED" Then
EligDays.Value = DateDiff("d", [RedetDue], [EligDate])
ElseIf [AppStatus].Value = "REDETERM" And [EligStatus].Value = "REACTIVATE"
Then
EligDays.Value = DateDiff("d", [Reassess], [EligDate])
Else
EligDays.Value = Null
End If
End Sub
I have two combo boxes AppStatus (with drop down NEW, REDETERM etc) & EligStatus (with drop down ELIG, DENIED etc) depending on what the user selects from each field, EligDays = the difference between two fields.
I'm new for programming. How do I get the result, (work days) not counting weekends, automatically to be filled in EligDays field?
Thanks,
DD
The following is the code i have please comment:
Private Sub AppStatus_AfterUpdate()
If [AppStatus].Value = "NEW" And [EligStatus].Value = "ELIG" Then
EligDays.Value = DateDiff("d", [AppRec], [EligDate])
ElseIf [AppStatus].Value = "NEW" And [EligStatus].Value = "DENIED" Then
EligDays.Value = DateDiff("d", [AppRec], [EligDate])
ElseIf [AppStatus].Value = "NEW" And [EligStatus].Value = "REACTIVATE" Then
EligDays.Value = DateDiff("d", [Reassess], [EligDate])
ElseIf [AppStatus].Value = "REDETERM" And [EligStatus].Value = "ELIG" Then
EligDays.Value = DateDiff("d", [RedetDue], [EligDate])
ElseIf [AppStatus].Value = "REDETERM" And [EligStatus].Value = "DENIED" Then
EligDays.Value = DateDiff("d", [RedetDue], [EligDate])
ElseIf [AppStatus].Value = "REDETERM" And [EligStatus].Value = "REACTIVATE"
Then
EligDays.Value = DateDiff("d", [Reassess], [EligDate])
Else
EligDays.Value = Null
End If
End Sub