J
JWhitehead
I have a menu type form, and on it there is a spot to count how many
outstanding transactions there are. What I am trying to do is get a total
count, how many are 30 days past due, and 60 days past due. I have gotten it
so that it will show the total number of outstanding, but not the 30 & 60
days. If I step through the code, it will calculate, but if I don't step
through, then it will not calculate. Any suggestions?
The code is:
Private Sub Form_Load()
Dim Days30 As Integer
Dim Days60 As Integer
Dim Counting As Integer
Dim Days As Integer
Counting = txtCount
Do While Counting > 0
Days = Now() - DateRequested
If Days >= 60 Then
Days60 = Days60 + 1
ElseIf Days >= 30 And Days < 60 Then
Days30 = Days30 + 1
End If
Counting = Counting - 1
DoCmd.GoToRecord , "", acNext
Loop
txtTotal = "Number of Incomplete Tasks: " & txtCount 'txtTotal and
txtCount are fields on form
txt30Days = Days30 & " are over 30 days old" 'txt30Days is field on form
txt60Days = Days60 & " are over 60 days old" 'txt60Days is field on form
End Sub
outstanding transactions there are. What I am trying to do is get a total
count, how many are 30 days past due, and 60 days past due. I have gotten it
so that it will show the total number of outstanding, but not the 30 & 60
days. If I step through the code, it will calculate, but if I don't step
through, then it will not calculate. Any suggestions?
The code is:
Private Sub Form_Load()
Dim Days30 As Integer
Dim Days60 As Integer
Dim Counting As Integer
Dim Days As Integer
Counting = txtCount
Do While Counting > 0
Days = Now() - DateRequested
If Days >= 60 Then
Days60 = Days60 + 1
ElseIf Days >= 30 And Days < 60 Then
Days30 = Days30 + 1
End If
Counting = Counting - 1
DoCmd.GoToRecord , "", acNext
Loop
txtTotal = "Number of Incomplete Tasks: " & txtCount 'txtTotal and
txtCount are fields on form
txt30Days = Days30 & " are over 30 days old" 'txt30Days is field on form
txt60Days = Days60 & " are over 60 days old" 'txt60Days is field on form
End Sub