我把我的这一部分程序贴出来,请大家帮忙看一下!
'//查找
Private Sub Command8_Click()
BM = Adodc1.Recordset.Bookmark
If Text1.Text = "" Then
Text1.SetFocus '获取焦点
MsgBox "请输入要查找的记录!"
GoTo cz_end
Text1.SetFocus
End If
If Text2.Text = "" Then
Text2.SetFocus '获取焦点
MsgBox "请输入要查找的记录!"
GoTo cz_end
Text1.SetFocus
End If
If Combo6.Text <> "" Or Text1.Text <> "" Or Text2.Text <> "" Then
Call QJSJ_cz
If BZ1 = 1 Then
MsgBox "没有找到相同的记录!", , "查找信息"
Adodc1.Recordset.Bookmark = BM
Else
Call QJSJ_DR
End If
cz_end:
End If
End Sub
'//查找子程序 SQL查询
Private Sub QJSJ_cz()
Adodc1.RecordSource = "SELECT * From 器件数据 WHERE 机号='" & Combo6.Text & "' And 回路='" & Text1.Text & "' And 地址='" & Text2.Text & "'"
Adodc1.Refresh
End Sub
ADODAT 這個是什麽?
me.Adodc1.RecordSource ="Select * From TableName Where 机号='"& text1.text &"' And 回路='"& text2.text &"' And 地址='"& text3.text &"'"
me.Adodc1.refresh