Soul777Toast
02-28-2008, 04:09 PM
Hi All,
I'm having a little wierdness with using the >= and <= comparison operators.
Can anyone tell me why these conditions
If StartTime.Value >= Range.StartTime And StartTime.Value <= Range.EndTime Then
MsgBox "Part Of This Range Has Already Been Selected. Please Select New Range", vbCritical
Unload Me
AddDataRangeForm.Show
Exit Sub
End If
would not trigger the if statements but these conditions
If StartTime.Value - Range.StartTime >= 0 And StartTime.Value - Range.EndTime <= 0 Then
MsgBox "Part Of This Range Has Already Been Selected. Please Select New Range", vbCritical
Unload Me
AddDataRangeForm.Show
Exit Sub
End If
work just fine with the same values for StartTime.Value, Range.StartTime and Range.EndTime (eg StartTime.Value = 5, Range.StartTime = 1, Range.EndTime = 10) in both instances?
Thanks Guys!
I'm having a little wierdness with using the >= and <= comparison operators.
Can anyone tell me why these conditions
If StartTime.Value >= Range.StartTime And StartTime.Value <= Range.EndTime Then
MsgBox "Part Of This Range Has Already Been Selected. Please Select New Range", vbCritical
Unload Me
AddDataRangeForm.Show
Exit Sub
End If
would not trigger the if statements but these conditions
If StartTime.Value - Range.StartTime >= 0 And StartTime.Value - Range.EndTime <= 0 Then
MsgBox "Part Of This Range Has Already Been Selected. Please Select New Range", vbCritical
Unload Me
AddDataRangeForm.Show
Exit Sub
End If
work just fine with the same values for StartTime.Value, Range.StartTime and Range.EndTime (eg StartTime.Value = 5, Range.StartTime = 1, Range.EndTime = 10) in both instances?
Thanks Guys!