Click here to Skip to main content
13,053,276 members (60,439 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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
Updated 12-Apr-13 21:31pm
du[DE] 13-Apr-13 3:02am
Set lstItem = lstLog.ListItems.Add(, , a) looks strange
Aleu Philip 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 13 Apr 2013
Copyright © CodeProject, 1999-2017
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