B
bastraker via AccessMonster.com
Hello All
I have the following code in my form and when I make a change the form locks
up. Am I missing something.
#########################################
Private Sub Form_AfterUpdate()
If Me.DateCommited >= Me.DateActual Then
Me.OnTime = "Yes"
Else
Me.OnTime = "Missed Target"
End If
On Error GoTo Err_WorkingDays
Dim intCount As Integer
Dim StartDate As Date, EndDate As Date
intCount = 0
StartDate = Me.DateAssigned
EndDate = Me.DateActual
Do While StartDate <= EndDate
Select Case Weekday(StartDate)
Case Is = 1, 7
intCount = intCount
Case Is = 2, 3, 4, 5, 6
intCount = intCount + 1
End Select
StartDate = StartDate + 1
Loop
Me.Duration = intCount
Exit_WorkingDays:
Exit Sub
Err_WorkingDays:
Select Case Err
Case Else
MsgBox Err.Description
Resume Exit_WorkingDays
End Select
End Sub
######################################
Any help would be greatly appreciated.
D
I have the following code in my form and when I make a change the form locks
up. Am I missing something.
#########################################
Private Sub Form_AfterUpdate()
If Me.DateCommited >= Me.DateActual Then
Me.OnTime = "Yes"
Else
Me.OnTime = "Missed Target"
End If
On Error GoTo Err_WorkingDays
Dim intCount As Integer
Dim StartDate As Date, EndDate As Date
intCount = 0
StartDate = Me.DateAssigned
EndDate = Me.DateActual
Do While StartDate <= EndDate
Select Case Weekday(StartDate)
Case Is = 1, 7
intCount = intCount
Case Is = 2, 3, 4, 5, 6
intCount = intCount + 1
End Select
StartDate = StartDate + 1
Loop
Me.Duration = intCount
Exit_WorkingDays:
Exit Sub
Err_WorkingDays:
Select Case Err
Case Else
MsgBox Err.Description
Resume Exit_WorkingDays
End Select
End Sub
######################################
Any help would be greatly appreciated.
D