这段代码有错?
Private Sub CmdInq_Click()
Dim stsql As String
stsql = "select * from 寄件明细表 where [部门] like '%" & Me.TxtDep & "%' and [寄件人] like '%" & Me.TxtPer & "%' and [快递机构] like '%" & Me.TxtVend & "%' and [目的地] like '%" & Me.TxtGo & "%'"
If IsNull(Me.TxtDate) Then
stsql = stsql & " and [日期] between '1970-01-01' and '2050-12-31'"
Else
stsql = stsql & " and [日期] = '" & Me.TxtDate & "'"
End If
Me.寄件明细表子窗体.Form.RecordSource = stsql
End Sub作者: tmtony 时间: 2010-8-10 20:17
点调试时, 光标定在哪个位置作者: Dragxixi 时间: 2010-8-12 09:07
点调试时,光标定在:
Me.寄件明细表子窗体.Form.RecordSource = stsql 作者: t小宝 时间: 2010-8-12 10:42
以出错的SQL语句建一个查询看是否能打开