I have a list box that displays columns of dates (SchedBegin, SchedEnd). For verification purposes, I need to ensure that the new SchedBegin, SchedEnd does not conflict with the results displayed in the list box. How do I step through each of the records? I'm pretty sure that I am in the ballpark with the following code, but I need a little extra push.
Thanks,
SWK.
Code:
Private Function IsDateClash(dtValue As Date) As Boolean
Dim ListControl As Counter
Dim bFlag As Boolean
ListControl = Me.lstPrevEntries.ListCount
bFlag = False
Do
Do While ListControl > 0
If dtValue > Me.lstPrevEntries.Column(0) And dtValue < Me.lstPrevEntries.Column(1) Then ' If condition is True.
bFlag = False
Exit Do
End If
Loop
Loop Until bFlag = False
IsDateClash = bFlag
End Function
Thanks,
SWK.