|
我在ME.TEXT1中设置了改变事件,在改变事件的处理函数中调用M_Query函数.可是不管我的TEXT怎么改变,Me.Text1,2,3都总是为NULL.这是怎么回事?
M_Query函数如下:
Private Sub M_Query()
strSQL = ""
If IsNull(Me.Text1) Then
strSQL = "format(检查时间,'yymmdd') LIKE '*'"
Else
strSQL = "format(检查时间,'yymmdd') = '" & Format(Me.Text1, "yymmdd") & "'"
End If
If IsNull(Me.Text2) Then
strSQL = strSQL & "检查地点 LIKE '*'"
Else
strSQL = strSQL + "AND 检查地点 LIKE '" & Me.Text2 & "*'"
End If
If IsNull(Me.Text3) Then
strSQL = "经营者姓名 LIKE '*'"
Else
strSQL = strSQL + "AND 经营者姓名 LIKE '*" & Me.Text3 & "*'"
End If
If bolSubVisible = False Then
Me.frmCaseInfomation.SourceObject = "frmCaseInfomation"
bolSubVisible = True
End If
If strSQL = "" Then
strSQL = "SELECT * FROM CaseDetail"
Else
strSQL = "SELECT * FROM CaseDetail WHERE " & strSQL
End If
Me.frmCaseInfomation.Form.RecordSource = strSQL
End Sub |
|