无法查询
Private Sub command1_click()condstr = ""
If Trim(Text1.Text) <> "" Then
If condstr = "" Then
condstr = "xinghao LIKE '" + Trim(Text1.Text) + "& '"
End If
End If
If Trim(Text2.Text) <> "" Then
If condstr = "" Then
condstr = "gongneng LIKE '" + Trim(Text2.Text) + "& '"
Else
condstr = condstr + "and gongneng LIKE '" + Trim(Text2.Text) + "& '"
End If
End If
If Trim(Text3.Text) <> "" Then
If condstr = "" Then
condstr = "fengzhuang LIKE '" + Trim(Text3.Text) + "& '"
Else
condstr = condstr + "and fengzhuang LIKE '" + Trim(Text3.Text) + "& '"
End If
End If
If Trim(Text4.Text) <> "" Then
If condstr = " " Then
condstr = "leibie LIKE '" + Trim(Text4.Text) + "& ' "
Else
condstr = condstr + "and leibie LIKE '" + Trim(Text4.Text) + "& '"
End If
End If
If condstr <> "" Then '已经写入条件
Adodc1.RecordSource = "select * from erjiguan where " + condstr
Adodc1.Refresh
Else '没有写入条件,返回原记录
Adodc1.RecordSource = "select * from erjiguan "
Adodc1.Refresh
End If
recs = Adodc1.Recordset.RecordCount
If recs = 0 Then
MsgBox "没有任何满足条件的器件", vbOKOnly, "信息提示"
End If
Call encomm
End Sub
表中有个元件型号为:1
我在xinghao的text1里面输入 1 之后点确定
却显示"没有任何满足条件的器件", secs还是为0
这是为什么呢?