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

📄 fillfrm.frm

📁 学生选课vb‘源程序?】蝪b‘源程序?】蝪b‘源程序?】蝪b‘源程序?】蝪b‘源程序?】蝪b‘源程序?】蝪b‘源程序?】蝪b‘源程序?】蝪b‘源程序?】蝪b‘源程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Fillfrm 
   Caption         =   "选课退课表单"
   ClientHeight    =   4425
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4425
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton abortcmd 
      Caption         =   "放弃"
      Height          =   375
      Left            =   3120
      TabIndex        =   10
      Top             =   3840
      Width           =   1215
   End
   Begin VB.CommandButton withdrawcmd 
      Caption         =   "退课"
      Height          =   375
      Left            =   1680
      TabIndex        =   9
      Top             =   3840
      Width           =   1215
   End
   Begin VB.CommandButton submitcmd 
      Caption         =   "选课"
      Height          =   375
      Left            =   240
      TabIndex        =   8
      Top             =   3840
      Width           =   1095
   End
   Begin VB.TextBox courseIDtxt 
      Height          =   375
      Left            =   1920
      TabIndex        =   7
      Top             =   2640
      Width           =   2415
   End
   Begin VB.TextBox courseNametxt 
      Height          =   375
      Left            =   1920
      TabIndex        =   6
      Top             =   1800
      Width           =   2415
   End
   Begin VB.TextBox IDtxt 
      Height          =   375
      Left            =   1920
      TabIndex        =   5
      Top             =   1080
      Width           =   2415
   End
   Begin VB.TextBox nametxt 
      Height          =   375
      Left            =   1920
      TabIndex        =   4
      Top             =   240
      Width           =   2415
   End
   Begin VB.Label Label4 
      Caption         =   "课程编号:"
      Height          =   495
      Left            =   120
      TabIndex        =   3
      Top             =   2520
      Width           =   1455
   End
   Begin VB.Label Label3 
      Caption         =   "课程名称:"
      Height          =   495
      Left            =   120
      TabIndex        =   2
      Top             =   1680
      Width           =   1455
   End
   Begin VB.Label Label2 
      Caption         =   "学号:"
      Height          =   495
      Left            =   120
      TabIndex        =   1
      Top             =   960
      Width           =   1455
   End
   Begin VB.Label Label1 
      Caption         =   "姓名:"
      Height          =   495
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1455
   End
End
Attribute VB_Name = "Fillfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub abortcmd_Click()
Fillfrm.Hide
End Sub

Private Sub Form_Load()
   With Fillfrm
   .Top = Screen.Height / 2 - .Height / 2
   .Left = Screen.width / 2 - .width / 2
   End With
   
End Sub
  
Private Sub submitcmd_Click()
   Dim rs As Recordset
   Dim sqlstr As String
   '打开"学号课程"表
   Set rs = courseDB.OpenRecordset("学号课程", dbOpenDynaset)
   sqlstr = "学号='" & IDtext & "'and 课程编号 = '" & courseIDtxt.Text & "'"
   rs.FindFirst (sqlstr) '在学号课程表中查找该用户是否已经选修了这么课程
   If rs.NoMatch Then   '如果没有选修该门课程
      '添加选课记录到学号课程表中
      With rs
    .AddNew
    !学号 = IDtxt.Text
    !课程编号 = .LastModified
    End With
    MsgBox "选课成功", vbOKOnly
    Fillfrm.Hide     '如果已经选修了该门课程
Else
   MsgBox "你已经选修了这门课程", vbOKOnly
   Fillfrm.Hide
   End If


 '关闭记录集
   rs.Close
End Sub



Private Sub withdrawcmd_Click()
    Dim rs As Recordset
    Dim sqlstr As String
    '打开"学号课程"表
    Set rs = courseDB.OpenRecordset("学号课程", dbOpenDynaset)
    sqlstr = "学号='" & IDtxtText & "'and 课程编号 = '" & courseIDtxt.Text & "'"
    rs.FindFirst (sqlstr)   '在学号课程表中查找高用户是否已经选修了这门课程
    If (Not rs.NoMatch) Then  '如果已经选修了该门课程
        RD.Delect
        MgBox "退课成功", vbOKOnly
        Fillfrm.Hide
    Else      '如果没有选修该门课程
        MsgBox "你没有选修这门课程", vbOKOnly
        Fillfrm.Hide
    End If
    '关闭记录集
    rs.Close
End Sub

⌨️ 快捷键说明

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