解释方法:
例:
Private Sub Command1_Click() ' 按钮1的单击事件
解释以下代码:
Private Sub Command1_Click()
Call OpenDouble
Dim i As Double
Dim sSQL As String
Dim sTemp As String
sSQL = "select * from Tasktable " & vbCrLf
For i = 1 To ListView1.ListItems.Count
If ListView1.ListItems(i).Checked = True Then
sTemp = sTemp & "'" & ListView1.ListItems(i).Text & "',"
End If
Next i
If sTemp <> "" Then
sSQL = sSQL & "where dtext14 in (" & Left(sTemp, Len(sTemp) - 1) & ")"
End If
rs.Open sSQL, cn, 1, 1
Set DataReport1.DataSource = rs
DataReport1.Show
Set rs = Nothing
Set cn = Nothing
End Sub