|
3#
楼主 |
发表于 2011-4-5 20:46:36
|
只看该作者
是VBA代码,请帮我看看错在哪里
Private Sub cmdQuery_Click()
On Error GoTo Err
Dim strsql As String
strsql = "SELECT 操作日记.操作时间, 操作日记.计算机名, UserList.UserName,"
strsql = strsql & " 操作日记.操作描述"
strsql = strsql & " FROM 操作日记 INNER JOIN"
strsql = strsql & " UserList ON 操作日记.操作员 = UserList.UserName"
strsql = strsql & " WHERE 操作日记.操作日记ID > 0"
If (Not IsNull(Me.txtStartDate)) And (Not IsNull(Me.txtEndDate)) Then
strsql = strsql & " AND 操作日记.操作时间 BETWEEN #" & Format(Me.txtStartDate, "yyyy-m-d 00:00:00") & "#"
strsql = strsql & " AND #" & Format(Me.txtEndDate, "yyyy-m-d 23:59:59") & "#"
End If
If Me.cboName <> 0 Then
strsql = strsql & " AND 操作日记.操作员 = " & Me.cboName
End If
strsql = strsql & " ORDER BY 操作日记.操作时间"
Debug.Print strsql
Me.操作日记窗体子窗体.Form.RecordSource = strsql
Exit Sub
Err:
MsgBox Err.Number & Err.Description
End Sub
|
|