I want to thank you for all your guidance and help. You have no idea how much you have helped me!!! I have one last question.
I would also like the WODD (Work Order Due Date) to update forward based on the WOSD. I played around with the code you added to update the WOSD date. This works great, but the user may override the Build Date if we choose to build the cabinets sooner because of space available in the plant, so I can't base it on the LotDelDate. Same setup, move forward 6,5, or 4 work days.
Private Sub UpdateWODD()
Dim AddColor As Boolean
Dim intNumDays As Integer
If Forms!FRMDELIVERY.Form.Status = "In Mill" Or _
Forms!FRMDELIVERY.Form.Status = "Sander" Or _
Forms!FRMDELIVERY.Form.Status = "In UV" Or _
Forms!FRMDELIVERY.Form.Status = "In Bank" Or _
Forms!FRMDELIVERY.Form.Status = "In Paint" Or _
Forms!FRMDELIVERY.Form.Status = "On Floor" Or _
Forms!FRMDELIVERY.Form.Status = "In Assembly" Or _
Forms!FRMDELIVERY.Form.Status = "Completed" Then
' '-- The process has started, too late to alter the Due Date!
Exit Sub
Else
If Not (Forms!FRMDELIVERY.Form.SpecialColor = 0) Then
AddColor = True
Else
AddColor = False
End If
Select Case Me.Style
Case "Eagle", "H/E", "F/E", "RP-9", "RP-22", "RP-23"
If AddColor Then
intNumDays = 6
Else
intNumDays = 5
End If
Case Else
If AddColor Then
intNumDays = 6
Else
intNumDays = 4
End If
End Select
Me.WODD = AddWorkdays(Me.LotDelDate, intNumDays)
End If
End Sub
Public Function AddWorkdays(dteStart As Date, intnNumDays As Integer) As Date
On Error GoTo Err_AddWorkDays
AddWorkdays = dteStart
Do While intNumDays > 0
AddWorkdays = AddWorkdays + 1
If Weekday(AddWorkdays, vbMonday) <= 5 And IsNull(DLookup("[Holiday]", "tblHolidays", "[HolDate] = #" & AddWorkdays & "#")) Then
intNumDays = intNumDays + 1
End If
Loop
Exit_AddWorkDays:
Exit Function
Err_AddWorkDays:
MsgBox "Error No: " & Err.Number & vbCr & _
"Description: " & Err.Description
Resume Exit_AddWorkDays
End Function