Form locking up

  • Thread starter bastraker via AccessMonster.com
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top