以下是我的语句,系统说from子句错误,adodc无法refresh
Private Sub Command2_Click()
On Error GoTo xerr
Dim xh As String
Dim xm As String
If Option1.Value = True Then
xh = Text1.Text
Adodc1.RecordSource = "select * form 学生信息 where 学生姓名='" & xh & "'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
ElseIf Option2.Value = True Then
xm = Text1.Text
Adodc1.RecordSource = "select * form 学生信息 where 课程名='" & xm & "'"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End If
Exit Sub
xerr:
MsgBox Err.Description, vbInformation, "提示"
End Sub
是From不是Form,关键词拼写错误。
Private Sub Command2_Click()