G
Guest
Hi all
This is the code I have on the exit event of a field - [fldTimeDF]
Private Sub fldTimeDF_Exit(Cancel As Integer)
If [fldPriority] = "High" Then
[fldDeadlineTime] = DateAdd("n", [UrgHtoADDinMin], [fldTimeDF])
[fldDeadlineDate] = [fldDateDF]
ElseIf [fldUniqueDeadlineFixedTime] = True Then
[fldDeadlineTime] = [fldUniqueTimeToReturn]
[fldDeadlineDate] = [fldDateDF]
ElseIf [fldUniqueDeadline] = True Then
[fldDeadlineTime] = DateAdd("n", [UHtoADDinMin], [fldTimeDF])
[fldDeadlineDate] = [fldDateDF]
ElseIf [fldPriority] = "Normal" Then
Select Case [fldTimeDF]
Case [fldTimeDF] >= [fldDeadLineStart1], Is <= [fldDeadlineEnd1]
[fldDeadlineTime] = [fldDeadlineTime1]
[fldDeadlineDate] = [fldDateDF]
Case [fldTimeDF] >= [fldDeadLineStart2], Is <= [fldDeadlineEnd2]
[fldDeadlineTime] = [fldDeadlineTime2]
[fldDeadlineDate] = DateAdd("d", 1, [fldDateDF])
If [DayOfWeek] = "1" Or "7" Then
[fldDeadlineDate] = DateAdd("d", 3, [fldDateDF])
End If
Case [fldTimeDF] >= [fldDeadLineStart3], Is >= [fldDeadlineEnd3]
[fldDeadlineTime] = [fldDeadlineTime3]
[fldDeadlineDate] = DateAdd("d", 1, [fldDateDF])
If [DayOfWeek] = "1" Or "7" Then
[fldDeadlineDate] = DateAdd("d", 3, [fldDateDF])
End If
End Select
End If
End Sub
I am having a real problem with the last two case statements - and
specifically the If statement that tests whether the day of the week is a 1
or a 7 . The way the code is working at the moment is that it is adding the
3 days regardless of whether or not the weekday is a 1 or a 7.
Can I not do an If within a Select Case? If not how do I get the select to
check the day of the week as well as the other conditions?
Please Help!!
This is the code I have on the exit event of a field - [fldTimeDF]
Private Sub fldTimeDF_Exit(Cancel As Integer)
If [fldPriority] = "High" Then
[fldDeadlineTime] = DateAdd("n", [UrgHtoADDinMin], [fldTimeDF])
[fldDeadlineDate] = [fldDateDF]
ElseIf [fldUniqueDeadlineFixedTime] = True Then
[fldDeadlineTime] = [fldUniqueTimeToReturn]
[fldDeadlineDate] = [fldDateDF]
ElseIf [fldUniqueDeadline] = True Then
[fldDeadlineTime] = DateAdd("n", [UHtoADDinMin], [fldTimeDF])
[fldDeadlineDate] = [fldDateDF]
ElseIf [fldPriority] = "Normal" Then
Select Case [fldTimeDF]
Case [fldTimeDF] >= [fldDeadLineStart1], Is <= [fldDeadlineEnd1]
[fldDeadlineTime] = [fldDeadlineTime1]
[fldDeadlineDate] = [fldDateDF]
Case [fldTimeDF] >= [fldDeadLineStart2], Is <= [fldDeadlineEnd2]
[fldDeadlineTime] = [fldDeadlineTime2]
[fldDeadlineDate] = DateAdd("d", 1, [fldDateDF])
If [DayOfWeek] = "1" Or "7" Then
[fldDeadlineDate] = DateAdd("d", 3, [fldDateDF])
End If
Case [fldTimeDF] >= [fldDeadLineStart3], Is >= [fldDeadlineEnd3]
[fldDeadlineTime] = [fldDeadlineTime3]
[fldDeadlineDate] = DateAdd("d", 1, [fldDateDF])
If [DayOfWeek] = "1" Or "7" Then
[fldDeadlineDate] = DateAdd("d", 3, [fldDateDF])
End If
End Select
End If
End Sub
I am having a real problem with the last two case statements - and
specifically the If statement that tests whether the day of the week is a 1
or a 7 . The way the code is working at the moment is that it is adding the
3 days regardless of whether or not the weekday is a 1 or a 7.
Can I not do an If within a Select Case? If not how do I get the select to
check the day of the week as well as the other conditions?
Please Help!!