⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form12.frm

📁 一个教学管理系统,可以满足一般课程设计的要求
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form12 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   " 成绩录入/修改"
   ClientHeight    =   3810
   ClientLeft      =   45
   ClientTop       =   375
   ClientWidth     =   4650
   LinkTopic       =   "Form12"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3810
   ScaleWidth      =   4650
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   3000
      TabIndex        =   9
      Top             =   360
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "下一个"
      Height          =   375
      Index           =   1
      Left            =   2400
      TabIndex        =   8
      Top             =   2280
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1920
      TabIndex        =   6
      Top             =   360
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Caption         =   "确定"
      Height          =   375
      Left            =   3000
      TabIndex        =   5
      Top             =   2880
      Width           =   855
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1680
      TabIndex        =   4
      Top             =   2880
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "上一个"
      Height          =   375
      Index           =   0
      Left            =   840
      TabIndex        =   2
      Top             =   2280
      Width           =   1215
   End
   Begin VB.Label Label4 
      Caption         =   "课程名称:"
      Height          =   255
      Left            =   720
      TabIndex        =   7
      Top             =   1200
      Width           =   3135
   End
   Begin VB.Label Label3 
      Caption         =   "学生成绩:"
      Height          =   375
      Left            =   720
      TabIndex        =   3
      Top             =   3000
      Width           =   1335
   End
   Begin VB.Label Label2 
      Caption         =   "学生编号:"
      Height          =   255
      Left            =   720
      TabIndex        =   1
      Top             =   1800
      Width           =   3135
   End
   Begin VB.Label Label1 
      Caption         =   "输入课序号:"
      Height          =   255
      Left            =   720
      TabIndex        =   0
      Top             =   480
      Width           =   1215
   End
End
Attribute VB_Name = "Form12"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs_test As New ADODB.Recordset

Private Sub Command1_Click()
Dim sql As String
  sql = "select * from lesson,choose where lesson.l_id=choose.l_id and choose.l_id=" & Text2.Text
  Call Conn
  rs_test.Open sql, Module1.conn_mdb, 3, 3
  rs_test.MoveFirst
  Call shows
  Text2.Enabled = False
End Sub

Private Sub shows()
   If Not rs_test.EOF And Not rs_test.BOF Then
      Label4.Caption = "课程名称:" & rs_test("l_name")
      Label2.Caption = "学生编号:" & rs_test("s_id")
      If rs_test("mark") < 100 And rs_test("mark") > 0 Then
         Text1.Text = rs_test("mark")
      Else
         Text1.Text = ""
      End If
   End If
End Sub

Private Sub Command2_Click(index As Integer)
Select Case index
     Case 0   '上一记录
        If Not rs_test.BOF Then
           rs_test.MovePrevious
           Call shows
        End If
        
     Case 1   '下一记录
        If Not rs_test.EOF Then
           rs_test.MoveNext
           Call shows
        End If
End Select
End Sub

Private Sub Command3_Click()
rs_test("mark") = Text1.Text
rs_test.Update
End Sub

Private Sub Form_Unload(Cancel As Integer)
If Text2.Enabled = False Then
  Call conclose
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -