VB代码问题高手帮忙

来源:百度知道 编辑:UC知道 时间:2024/06/05 10:18:01
就是做个成绩统计表 把各课成绩统计出来 找出不及格的科目 现实不及格科目的和分数 高手帮忙啊 我这个代码不会写
我写的是显示分数 不显示不及格科目我想让他都显示

四个文本框,一个用来输入被查找者的姓名,另外三个分别显示数学,语文,英语分数,两个command按钮,command1是不及格科目查找,另一个刷新,其余都是label框。代码如下:
Private Sub Command1_Click()
Adodc1.CommandType = adCmdText
Adodc1.ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & App.Path & "\db.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from a where 姓名='" & Text1.Text & " ' "
Adodc1.Refresh
Set Text2.DataSource = Adodc1
Set Text3.DataSource = Adodc1
Set Text4.DataSource = Adodc1
Text2.DataField = "数学"
Text3.DataField = "语文"
Text4.DataField = "英语"
If Val(Text2.Text) < 60 Then
Label4.Visible = True
Text2.Visible = True
End If

If Val(Text3.Text) < 60 Then
Label5.Visible = True
Text3.Visible = True
End If

If Val(Text4.Text) < 60 Then
Label6.Visible = True
Text4.Visible = True
End If

End Sub