|
改了一下,用下面的代码。
Private Sub Command53_Click()
Dim strCriteria As String
If Not IsNull(Text77) Then
strCriteria = "维保工号 like '*" & Text77 & "*' and "
End If
If Not IsNull(Combo90) Then
strCriteria = strCriteria & "用户单位名称 like '*" & Combo90 & "*' and "
End If
If Len(strCriteria) <> 0 Then
strCriteria = " where " & Mid(strCriteria, 1, Len(strCriteria) - 5)
End If
Me.施工单查询_子窗体.Form.RecordSource = "Select * From 施工单 " & strCriteria
Me.施工单查询_子窗体.Requery
End Sub |
|