Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2000 Calculations

Status
Not open for further replies.

OCM

MIS
Sep 12, 2002
220
US
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top