>Dim lADO As clsCeDataClass = New clsCeDataClass >Dim lstData As clsListOrComboBoxData = New clsListOrComboBoxData >Dim arlData As New ArrayList >Dim strClient As String >Dim strTime As String >Dim strSeq As String >Dim strPSeq As String >Dim strStartDate As String >Dim strEndDate As String >Dim strPrefix As String >Dim strSufix As String >Dim strLine As String >Dim intLoaded As Int16 >Dim ldrRoute As DataRow > >intLoaded = 0 >WaitCursor(True) > >Me.lstRoutes.DisplayMember = "" >Me.lstRoutes.ValueMember = "" >Me.lstRoutes.DataSource = Nothing > >strStartDate = FormatDateTime(Now, vbShortDate) & " 00:00:01" >strEndDate = FormatDateTime(Now, vbShortDate) & " 23:59:59" > >lADO.strSQL = "SELECT ID, Sequence, Location, DateScheduled, " & _ > "LocationID, Stopped " & _ > "FROM tRoutes " & _ > "WHERE (RouteID='" & Trim(CStr(glngRouteID)) & "') AND " & _ > "(DateScheduled >='" & strStartDate & "') AND " & _ > "(DateScheduled <='" & strEndDate & "') " & _ > "ORDER BY Sequence" >lADO.RetrieveData(lADO.objDS, "tRoutes") > >For Each ldrRoute In lADO.objDS.Tables("tRoutes").Rows > intLoaded = 1 > strSeq = CStr(CInt(ldrRoute("Sequence"))) > > If Len(strSeq) = 1 Then > strSeq = " " & strSeq > End If > > If strSeq <> strPSeq Then > strClient = ClientName(Convert.ToString(ldrRoute("LocationID"))) > strTime = FormatDateTime(ldrRoute("DateScheduled"), vbShortTime) > lstData.DisplayData = strSeq & ": " & strTime & " - " & _ > strClient & " (" & ldrRoute("Location") & ")" > lstData.ValueData = Convert.ToInt64(Convert.ToString _ > (ldrRoute("ID"))) > > If ldrRoute("Stopped") = "Y" Then > > 'Fix Display > strLine = lstData.DisplayData > If InStr(1, strLine, Chr(164)) = 0 Then > strPrefix = Mid(strLine, 1, InStr(1, strLine, "-") - 1) > strSufix = Mid(strLine, InStr(1, strLine, "-") + 1) > strLine = strPrefix & Chr(164) & strSufix > lstData.DisplayData = strLine > End If > > End If > > arlData.Add(lstData) > End If > strPSeq = strSeq > lstData = New clsListOrComboBoxData >Next > >If intLoaded < 1 Then > lstData.DisplayData = "No routes scheduled" > lstData.ValueData = 0 > arlData.Add(lstData) >Else > strSeq = Trim(CStr(CInt(strSeq) + 1)) > lstData.DisplayData = strSeq & ": " & strTime & " - END OF DAY (EOD)" > lstData.ValueData = 99999 > arlData.Add(lstData) >End If > >Me.lstRoutes.DataSource = arlData >Me.lstRoutes.DisplayMember = "DisplayData" >Me.lstRoutes.ValueMember = "ValueData" > >WaitCursor(False) >