文档详情

《课程管理系统》课程设计.ppt

发布:2017-11-14约1.37万字共58页下载文档
文本预览下载声明
Private Sub cmdPrevious_Click() Adodc1.Recordset.MovePrevious If Adodc1.Recordset.BOF Then msg = MsgBox(已是首记录, vbYesNo, 警告) Adodc1.Recordset.MoveNext End If End Sub Private Sub cmdSave_Click() Adodc1.Recordset.Save End Sub Private Sub fi2_Click() frmMain.Show Me.Visible = False End Sub Private Sub fi4_Click() emd End Sub 图4-2 运行后的课程管理窗体 4.2 学生基本信息窗体 窗体设计方法与课程管理窗体相似,不再重复叙述。界面如图2-10所示。 图4-3 学生基本信息窗体 学生基本信息窗体各控件的代码: Private Sub CmdNameF_Click() Dim XM As String Adodc1.Recordset.MoveFirst XM = Adodc1.Recordset.Bookmark Adodc1.Recordset.Find StudentName= txtStudentNF.Text txtStudentNF.Text = If Adodc1.Recordset.EOF = True Then msg = MsgBox(请先输入要查找的学生姓名,再点击[姓名查找]按钮!, vbYesNo, 提示信息) txtStudentNF.Text = txtStudentNF.SetFocus End If End Sub Private Sub cmdStudentidF_Click() Dim xh As String Adodc1.Recordset.MoveFirst XM = Adodc1.Recordset.Bookmark Adodc1.Recordset.Find StudentID= txtStudentidF.Text txtStudentidF.Text = If Adodc1.Recordset.EOF = True Then msg = MsgBox(请先输入要查找的学生学号,再点击[学号查找]按钮。, vbYesNo, 提示信息) txtStudentidF.Text = txtStudentidF.SetFocus End If End Sub Private Sub cmdFirst_Click() Adodc1.Recordset.MoveFirst End Sub Private Sub cmdPrevious_Click() Adodc1.Recordset.MovePrevious If Adodc1.Recordset.BOF Then msg = MsgBox(已是首记录, vbYesNo, 提示信息) Adodc1.Recordset.MoveNext End If End Sub Private Sub cmdNext_Click() Adodc1.Recordset.MoveNext If Adodc1.Recordset.EOF Then msg = MsgBox(已是末记录, vbYesNo, 提示信息) Adodc1.Recordset.MoveFirst End If End Sub Private Sub cmdLast_Click() Adodc1.Recordset.MoveLast If Adodc1.Recordset.EOF Then msg = MsgBox(已是末记录, vbYesNo, 提示信息) Adodc1.Recordset.MoveFirst End If End Sub Private Sub cmdAdd_Click() Dim StuID As String Adodc1.Recordset.AddNew If txtStudentID.Text = Then msg = MsgBox(学号不能为空,必须输入!, vbYesNo, 提示信息) End If txtStudentName.Text = txtStudentSex.Text = txtClassID.Tex
显示全部
相似文档