我想做一个数据查询的东西,假设有一个db.mdb已经和data1连接,数据库中的两项ID(关键字)和text1连接,姓名和text2连接,text3是一个查询文本框,用来输入要查询的ID,按钮表示开始查询,对于按钮命令代码如下
Dim findname As String
Dim findstr As String
findname = Text3.Text
If findname <> "" Then
findstr = "[ID] like " & "'" & findname & "'"
Data1.Recordset.FindFirst findstr
If Data1.Recordset.NoMatch Then
MsgBox "没有匹配项", vbOKOnly, "错误"
End If
End If
请问
findstr = "[ID] like " & "'" & findname & "'"
Data1.Recordset.FindFirst findstr
什么意思?findstr起什么作用,能不能直接用findname变量查询结果?