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

📄 frmsubject.frm

📁 This project is developed for school management system in vb and sql server 2000. All source code in
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            _Version        =   393216
            Rows            =   0
            FixedRows       =   0
            FixedCols       =   0
            BackColorFixed  =   14737632
            BackColorBkg    =   14737632
            BackColorUnpopulated=   16777215
            FocusRect       =   2
            SelectionMode   =   1
            Appearance      =   0
            _NumberOfBands  =   1
            _Band(0).Cols   =   2
         End
         Begin VB.Label Label2 
            BackStyle       =   0  'Transparent
            Caption         =   "Exit"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   315
            Left            =   10350
            TabIndex        =   40
            Top             =   3720
            Width           =   405
         End
         Begin VB.Image Image1 
            Height          =   840
            Left            =   10200
            Picture         =   "frmSubject.frx":44DAD
            Stretch         =   -1  'True
            Top             =   2640
            Width           =   795
         End
      End
      Begin VB.Frame ButtFrame 
         BackColor       =   &H80000004&
         Height          =   1185
         Left            =   0
         TabIndex        =   9
         Top             =   4200
         Width           =   11235
         Begin VB.PictureBox OpBtn 
            Appearance      =   0  'Flat
            BackColor       =   &H80000004&
            FillColor       =   &H008080FF&
            ForeColor       =   &H80000008&
            Height          =   585
            Left            =   120
            ScaleHeight     =   555
            ScaleWidth      =   10545
            TabIndex        =   10
            Top             =   120
            Width           =   10575
            Begin VB.CommandButton Command2 
               BackColor       =   &H00E0E0E0&
               Caption         =   "&Next"
               Height          =   315
               Left            =   9240
               TabIndex        =   39
               Top             =   120
               Width           =   1065
            End
            Begin VB.CommandButton Command1 
               BackColor       =   &H00E0E0E0&
               Caption         =   "&Back"
               Height          =   315
               Left            =   8034
               TabIndex        =   38
               Top             =   120
               Width           =   1065
            End
            Begin VB.CommandButton cmdCancel 
               BackColor       =   &H00E0E0E0&
               Caption         =   "&Cancel"
               Enabled         =   0   'False
               Height          =   315
               Left            =   6710
               TabIndex        =   8
               Top             =   120
               Width           =   1065
            End
            Begin VB.CommandButton cmdSave 
               BackColor       =   &H00E0E0E0&
               Caption         =   "&Save"
               Enabled         =   0   'False
               Height          =   315
               Left            =   5386
               MaskColor       =   &H008080FF&
               TabIndex        =   7
               Top             =   120
               UseMaskColor    =   -1  'True
               Width           =   1065
            End
            Begin VB.CommandButton cmdFind 
               BackColor       =   &H00E0E0E0&
               Caption         =   "&Find.."
               Height          =   315
               Left            =   4062
               TabIndex        =   14
               Top             =   120
               Width           =   1065
            End
            Begin VB.CommandButton cmdDelete 
               BackColor       =   &H00E0E0E0&
               Caption         =   "&Delete"
               Height          =   315
               Left            =   2738
               TabIndex        =   13
               Top             =   120
               Width           =   1065
            End
            Begin VB.CommandButton cmdEdit 
               BackColor       =   &H00E0E0E0&
               Caption         =   "&Edit"
               Height          =   315
               Left            =   1414
               TabIndex        =   12
               Top             =   120
               Width           =   1065
            End
            Begin VB.CommandButton cmdAddNew 
               BackColor       =   &H00E0E0E0&
               Caption         =   "Add &New"
               Height          =   315
               Left            =   90
               MaskColor       =   &H00E0E0E0&
               TabIndex        =   11
               Top             =   120
               UseMaskColor    =   -1  'True
               Width           =   1065
            End
         End
         Begin VB.PictureBox Picture1 
            Appearance      =   0  'Flat
            BackColor       =   &H00E0E0E0&
            FillColor       =   &H008080FF&
            ForeColor       =   &H80000008&
            Height          =   375
            Left            =   150
            ScaleHeight     =   345
            ScaleWidth      =   8145
            TabIndex        =   15
            Top             =   750
            Visible         =   0   'False
            Width           =   8175
            Begin VB.PictureBox picStatBox 
               Appearance      =   0  'Flat
               BackColor       =   &H00E0E0E0&
               BorderStyle     =   0  'None
               ForeColor       =   &H80000008&
               Height          =   300
               Left            =   90
               ScaleHeight     =   300
               ScaleWidth      =   7995
               TabIndex        =   16
               Top             =   30
               Width           =   7995
               Begin VB.CommandButton cmdFirst 
                  BackColor       =   &H00C0C0C0&
                  Height          =   300
                  Left            =   0
                  Picture         =   "frmSubject.frx":466F7
                  Style           =   1  'Graphical
                  TabIndex        =   20
                  Top             =   0
                  UseMaskColor    =   -1  'True
                  Width           =   345
               End
               Begin VB.CommandButton cmdPrevious 
                  BackColor       =   &H00C0C0C0&
                  Height          =   300
                  Left            =   345
                  Picture         =   "frmSubject.frx":46A39
                  Style           =   1  'Graphical
                  TabIndex        =   19
                  Top             =   0
                  UseMaskColor    =   -1  'True
                  Width           =   345
               End
               Begin VB.CommandButton cmdNext 
                  BackColor       =   &H00C0C0C0&
                  Height          =   300
                  Left            =   7260
                  Picture         =   "frmSubject.frx":46D7B
                  Style           =   1  'Graphical
                  TabIndex        =   18
                  Top             =   0
                  UseMaskColor    =   -1  'True
                  Width           =   345
               End
               Begin VB.CommandButton cmdLast 
                  BackColor       =   &H00C0C0C0&
                  Height          =   300
                  Left            =   7605
                  Picture         =   "frmSubject.frx":470BD
                  Style           =   1  'Graphical
                  TabIndex        =   17
                  Top             =   0
                  UseMaskColor    =   -1  'True
                  Width           =   345
               End
               Begin VB.Label lblStatus 
                  Alignment       =   2  'Center
                  BackColor       =   &H00FFFFFF&
                  BorderStyle     =   1  'Fixed Single
                  Height          =   285
                  Left            =   690
                  TabIndex        =   21
                  Top             =   0
                  Width           =   6585
               End
            End
         End
      End
   End
End
Attribute VB_Name = "frmSubject"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim WithEvents rs As ADODB.Recordset
Attribute rs.VB_VarHelpID = -1
Dim rsgrid As New ADODB.Recordset
Dim RsCombo As New ADODB.Recordset
Dim Mv As Variant
Dim Ch As Boolean
Dim p As Integer, q As Integer
Dim ZP As Double

Private Sub cmbCourse_Click()
ShowSemester
 If cmbCourse.ListIndex = -1 Then Exit Sub
  p = cmbCourse.ItemData(cmbCourse.ListIndex)
 If cmbCourse.ListIndex = -1 Or cmbSemester.ListIndex = -1 Then
  cmdSav.Enabled = False
 Else
    If rs.EditMode = adEditAdd Then Exit Sub
  cmdSav.Enabled = True
 End If
End Sub

Private Sub cmbCourse_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
 SendKeys "{tab}"
End If
End Sub

Private Sub cmbSemester_Click()
 q = cmbSemester.ListIndex + 1
If cmbCourse.ListIndex = -1 Or cmbSemester.ListIndex = -1 Then
  cmdSav.Enabled = False
 Else
   If rs.EditMode = adEditAdd Then Exit Sub
  cmdSav.Enabled = True
 End If
End Sub

Private Sub cmdAddNew_Click()
 If Not rs.EOF Or Not rs.BOF Then
 Mv = rs.Bookmark
 End If
 EnableButtons
 
 rs.AddNew
 cmbCourse.ListIndex = -1
 cmbSemester.ListIndex = -1
 lblSub_ID = AutoNumber + 1
   SetMainGrid
 T(0).SetFocus
 DT.Value = Date
End Sub

Private Sub cmdCan_Click()
  cmbCourse.ListIndex = -1
  cmbSemester.ListIndex = -1
  SetMainGrid
  cmdCan.Enabled = False
End Sub

Private Sub cmdCancel_Click()
On Error Resume Next
 rs.CancelUpdate

 If Mv > 0 Then
   rs.Bookmark = Mv
 Else
   rs.Requery
 End If
 DisableButtons
   cmbCourse.ListIndex = -1
  cmbSemester.ListIndex = -1
  cmdCan_Click
  
End Sub

Private Sub cmdDelete_Click()
N = MsgBox("Are You sure you want to delete the record", vbYesNo + vbInformation, App.Comments)
If N = vbYes Then
  rs.Delete adAffectCurrent
 rs.Requery
End If
 SetGridData
 SetMainGrid
End Sub

Private Sub cmdEdit_Click()
 EnableButtons
  lblStatus.Caption = "Editing Record....."
End Sub

Private Sub cmdFind_Click()
rs.Requery

U = InputBox("Enter the ID which you want to search")
rs.Find "sub_id=" & Val(U), 0, adSearchForward, 1
If rs.EOF Then
 rs.Requery
 MsgBox "No match Found...", vbInformation, App.Comments
End If
 SetMainGrid
End Sub

Private Sub cmdFirst_Click()
 rs.MoveFirst

End Sub

Private Sub cmdLast_Click()
 rs.MoveLast

End Sub

Private Sub cmdNext_Click()
 rs.MoveNext
 
 If rs.EOF Then
    rs.MoveLast
   MsgBox "YOU ARE AT THE LAST RECORD ", vbInformation, App.Comments
 End If

End Sub

Private Sub cmdPrevious_Click()
 rs.MovePrevious

 If rs.BOF Then
    rs.MoveFirst
    MsgBox "YOU ARE AT THE FIRST RECORD ", vbInformation, App.Comments
 End If

End Sub



Private Sub cmdPrint_Click()
 frmMain.SB1.Panels(1).Text = "NOTHING IS TO PRINT"
End Sub

Private Sub cmdSav_Click()
On Error GoTo 1
 If Ch = True Then
   frmMain.Cn.Execute "update sub_course set course_id=" & p & ",semester=" & _
               q & " where sub_id = " & Val(lblSub_ID.Caption) & " AND COURSE_ID=" & _
               ZP
    Ch = False
 Else
      frmMain.Cn.Execute "insert into sub_course values (" & _
               lblSub_ID.Caption & "," & p & "," & q & " )"
End If
  cmbCourse.ListIndex = -1
  cmbSemester.ListIndex = -1

⌨️ 快捷键说明

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