Private Sub Command3_Click()
Unload Me
End Sub
Private Sub DataGrid1_Click()
Frm_AddClass.Adodc1.RecordSource = "select * from 班级表 where 年级 = '" & Trim(DataGrid1.Row) & "'"
Text1.Text = Frm_AddClass.Adodc1.Recordset.Fields("年级")
Text2.Text = Frm_AddClass.Adodc1.Recordset.Fields("专业")
Text3.Text = Frm_AddClass.Adodc1.Recordset.Fields("人数")
Text4.Text = Frm_AddClass.Adodc1.Recordset.Fields("辅导员")
Text5.Text = Frm_AddClass.Adodc1.Recordset.Fields("备注")
Command1.Enabled = False
Command2.Enabled = True
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Frm_AddClass.Adodc1.Refresh
Frm_AddClass.DataGrid1.Refresh
End Sub
Private Sub Text1_Change()
Command1.Enabled = True
End Sub
当输入查询类别、运算符和条件后可以查找到所需要的班级设置。
Private Sub Command1_Click()
Dim a As String
Dim BJCX1 As String
Dim BJCX2 As String
a = Trim(Combo2)
Select Case a
Case "="
BJCX1 = "" & Combo1.Text & " " & Combo2.Text & " '" & Trim(Text1) & "'"
Case "like"
BJCX1 = "Instr(1," & Combo1.Text & ",'" & Trim(Text1.Text) & "')<>0 "
End Select
a = Trim(Combo4)
Select Case a
Case "="
BJCX2 = "" & Combo3.Text & " " & Combo4.Text & " '" & Trim(Text2) & "'"
Case "like"
BJCX2 = "Instr(1," & Combo3.Text & ",'" & Trim(Text2.Text) & "')<>0 "
End Select
If Option1.Value = True Then
If BJCX1 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX2
ElseIf BJCX2 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX1
Else
strTiaoJian = "select * from 班级表 where " & BJCX1 & "and " & BJCX2
End If
ElseIf Option2.Value = True Then
If BJCX1 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX2
ElseIf BJCX2 = "" Then
strTiaoJian = "select * from 班级表 where " & BJCX1
Else
strTiaoJian = "select * from 班级表 where " & BJCX1 & "or " & BJCX2
End If
Else
If BJCX1 = "" Then
www.youerw.com
MsgBox "请输入查询条件!", vbOKOnly, "警告"
Exit Sub
Else
Unload Me
Frm_UpdateClass.Show 1
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;Persist Security Info=False"
Combo1.AddItem ("年级")
Combo1.AddItem ("专业")
Combo1.AddItem ("人数")
Combo1.AddItem ("辅导员")
Combo2.AddItem ("=")
Combo3.AddItem ("年级")
Combo3.AddItem ("专业")
Combo3.AddItem ("人数")
Combo3.AddItem ("辅导员")
Combo4.AddItem ("=")
Combo1.Text = ""
Combo2.Text = ""
Text1.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Text2.Text = ""
End Sub
学生档案管理:档案设置与档案查询
运行程序后,进入档案管理模块,档案管理模块的学生档案增加,在这模块中可以把学号、姓名、年级、性别、专业、政治面貌、民族、籍贯、家庭地址、备注等信息输入,以便使用。
代码如下:
Dim myCon As New ADODB.Connection
Dim myRs As New ADODB.Recordset
Private Sub Command1_Click()
Dim XueHao, XingMing, NianJi, ZhuanY, XingBie, MZ, JG, ZZMM, JTDZ, YZBM, LXDH, BZ As String
XueHao = Text1.Text
XingMing = Text2.Text
NianJi = Text3.Text
ZhuanY = Text4.Text
XingBie = Combo2.Text
MZ = Text7.Text
JG = Text8.Text
ZZMM = Combo1.Text
JTDZ = Text9.Text
YZBM = Text10.Text
LXDH = Text11.Text
BZ = Text12.Text
If Trim(XueHao) = "" Or Trim(XingMing) = "" Or Trim(NianJi) = "" Or Trim(ZhuanY) = "" Or Trim(XingBie) = "" Or Trim(MZ) = "" Or Trim(JG) = "" Or Trim(ZZMM) = "" Or Trim(JTDZ) = "" Or Trim(YZBM) = "" Or Trim(LXDH) = "" Then
MsgBox "学生档案资料不能为空,请填写!"
Exit Sub
End IfmyCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=信息.mdb;"
myRs.Open "select * from 学生档案 where 学号='" & Trim(Text1.Text) & "' and 姓名='" & Trim(Text2.Text) & "'", myCon
If myRs.EOF = False Then
MsgBox "该学生档案已经存在,请重新输入!"
上一页 [1] [2] [3] [4] [5] [6] 下一页