Private Sub FlatBttn1_Click()
Dim rs As ADODB.Recordset
Dim comm As ADODB.Command
Set comm = New ADODB.Command
Set rs = New ADODB.RecordsetOn Error GoTo here
Set comm.ActiveConnection = conncomm.CommandType = adCmdTextcomm.CommandText = "SELECT * From ? where 选修年份='" & 这里是变量 & "'"Set rs = comm.ExecuteSet subjectDataReport.datasource = comm.ExecutesubjectDataReport.Sections("section1").Controls("text1").DataField = "?"
subjectDataReport.Sections("section1").Controls("text2").DataField = "?"
……
subjectDataReport.Sections("section4").Controls("label8").Caption = rs("?")
subjectDataReport.Sections("section4").Controls("label11").Caption =?
subjectDataReport.Show 1
Exit Sub
here:
MsgBox "有误", vbInformation, "错误"
End Sub