On Error GoTo Err_deliver_Click
'这里将使用DAO来改变查询的SQL语句,必须先在“工具”→“引用”中选择
'Microsoft DAO 3.6 Object Library.
'================================
Dim Check As DAO.QueryDef 'qdf被定义为一个查询定义对象
Dim strWhere, strSQL As String
strWhere = Me.ACCcsub.Form.Filter
If strWhere = "" Then
' '没有条件
strSQL = "SELECT * FROM [ACCc]"
Else
'有条件
strSQL = "SELECT * FROM [ACCc] WHERE " & strWhere
End If
Set Check = CurrentDb.QueryDefs("result")
Check.SQL = strSQL
Check.Close