Private Sub Command1_Click()
Dim rs As New ADODB.Recordset
If (Text1.Text = "") Or (Combo1.Text = "") Then
MsgBox "条件不能为空", vbQuestion, "提示信息"
Combo1.SetFocus
Else
Set rs = cnn.Execute("select * from 供货商明细表 where +'" + Trim(Combo1.Text) + "' like + '%' +'" + Trim(Text1.Text) + "'+ '%'")
If rs.RecordCount > 0 Then
MsgBox "找到符合的记录", vbQuestion, "提示信息"
Else
MsgBox "没找到符合的记录", vbQuestion, "提示信息"
End If
rs.Close
End If
End Sub