Click here to Skip to main content
11,566,785 members (53,335 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB6
Am trying to create a form that displays userlog. below is my sub routine; DisplayUserLog. Am getting the following error at runtime: Run-time error '-2147217900 (80040e14)': incorrect syntax...

Sub DisplayUserLog(lstLog As ListView, mDate As Date)
Dim lstItem As ListItem, a As Integer
If Rs.State = adStateOpen Then Rs.Close
   sql = " Select * From Userlog Where (Userlog.Date)=#" & mDate & "#"
   Rs.Open sql, RSconn
   Do While Not Rs.EOF
    a = a + 1
        Set lstItem = lstLog.ListItems.Add(, , a)
            lstItem.SubItems(1) = Rs(1).Value
            lstItem.SubItems(2) = Rs(2).Value
             If IsNull(Rs(3).Value) Then
                lstItem.SubItems(3) = ""
                lstItem.SubItems(3) = Rs(3).Value
             End If
            lstItem.SubItems(4) = Rs(4).Value
End Sub
Posted 12-Apr-13 20:57pm
Edited 12-Apr-13 21:31pm
du[DE] at 13-Apr-13 3:02am
Set lstItem = lstLog.ListItems.Add(, , a) looks strange
Aleu Philip at 13-Apr-13 3:12am
a way of adding new values to the list at runtime

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS

Advertise | Privacy | Mobile
Web04 | 2.8.150624.2 | Last Updated 13 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100