Private Sub 查询_Click()
If Combo1.Text = "" And Combo2.Text = "" And Combo3.Text = "" Then
MsgBox ("请输入一个查询依据!")
Combo1.SetFocus
Exit Sub
End If
If Option1(0).Value = False And Option1(1).Value = False And Option1(2).Value = False Then
MsgBox ("请确定一个搜索依据!")
Exit Sub
End If
If Option1(0).Value = True Then
If Not IsNumeric(Combo1.Text) Then
MsgBox ("编号请输入数字!")
Combo1.SetFocus
Exit Sub
End If
Adodc1.RecordSource = "select * from suppliers供应商信息表 where 供应商编号='" & Combo2.Text & "' order by 供应商编号"
Adodc1.Refresh
DataGrid1.Refresh
Exit Sub
End If
If Option1(1).Value Then
Adodc1.RecordSource = "select * from suppliers供应商信息表 where 公司名称='" & Combo2.Text & "' order by 编号"
Adodc1.Refresh
DataGrid1.Refresh
Exit Sub
End If
If Option1(2).Value Then
Adodc1.RecordSource = "select * from suppliers供应商信息表 where 联系人姓名='" & Combo3.Text & "' order by 编号"
Adodc1.Refresh
DataGrid1.Refresh
End If
end sub
提示FROM子语法错误,Adodc1.Refresh不能实现。在线等,帮帮忙啊,急