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

📄 addclasss.frm

📁 简单的数据库系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            End
            Begin VB.CommandButton Command3 
               Caption         =   "第一条记录"
               Height          =   615
               Left            =   120
               TabIndex        =   18
               Top             =   360
               Width           =   1455
            End
         End
         Begin VB.Label Label6 
            Caption         =   "请 输 入 查 询 条 件"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   240
            TabIndex        =   16
            Top             =   600
            Width           =   2535
         End
      End
      Begin VB.Frame Frame1 
         Height          =   4575
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   8295
         Begin VB.Frame Frame6 
            Height          =   2295
            Left            =   240
            TabIndex        =   30
            Top             =   1080
            Width           =   6255
            Begin VB.TextBox Text1 
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FF0000&
               Height          =   495
               Index           =   2
               Left            =   4080
               TabIndex        =   38
               Top             =   480
               Width           =   1935
            End
            Begin VB.TextBox Text1 
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FF0000&
               Height          =   495
               Index           =   0
               Left            =   1080
               TabIndex        =   35
               Top             =   480
               Width           =   1935
            End
            Begin VB.TextBox Text1 
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FF0000&
               Height          =   495
               Index           =   3
               Left            =   4080
               TabIndex        =   34
               Top             =   1440
               Width           =   1935
            End
            Begin VB.TextBox Text1 
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FF0000&
               Height          =   495
               Index           =   1
               Left            =   1080
               TabIndex        =   32
               Top             =   1440
               Width           =   1935
            End
            Begin VB.Label Label1 
               Caption         =   "班号"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   495
               Index           =   0
               Left            =   240
               TabIndex        =   37
               Top             =   600
               Width           =   1095
            End
            Begin VB.Label Label3 
               Caption         =   "年级"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   495
               Index           =   0
               Left            =   3240
               TabIndex        =   36
               Top             =   480
               Width           =   615
            End
            Begin VB.Label Label4 
               Caption         =   "教室"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   495
               Left            =   3240
               TabIndex        =   33
               Top             =   1440
               Width           =   495
            End
            Begin VB.Label Label7 
               Caption         =   "班主任"
               BeginProperty Font 
                  Name            =   "宋体"
                  Size            =   12
                  Charset         =   134
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   495
               Left            =   240
               TabIndex        =   31
               Top             =   1560
               Width           =   855
            End
         End
         Begin VB.Frame Frame2 
            Height          =   2295
            Left            =   6600
            TabIndex        =   2
            Top             =   1080
            Width           =   1575
            Begin VB.CommandButton Command2 
               Caption         =   "关闭(&C)"
               Height          =   615
               Left            =   120
               TabIndex        =   4
               Top             =   1080
               Width           =   1335
            End
            Begin VB.CommandButton Command1 
               Caption         =   "确定(&O)"
               Height          =   615
               Left            =   120
               TabIndex        =   3
               Top             =   240
               Width           =   1335
            End
         End
      End
   End
End
Attribute VB_Name = "addclasss"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False




Private Sub Command1_Click()
If Command1.Caption = "确定(&O)" Then
    If Not Testtxt(Text1(0).Text) Then
      MsgBox "请输入班号!", 48, "提示"
      Text1(0).SetFocus
      Exit Sub
    End If
     If Not Testtxt(Text1(1).Text) Then
      MsgBox "请输入班主任!", 48, "提示"
      Text1(1).SetFocus
      Exit Sub
    End If
     If Not Testtxt(Text1(3).Text) Then
      MsgBox "请输入教室!", 48, "提示"
      Text1(2).SetFocus
      Exit Sub
    End If
     If Not Testtxt(Text1(2).Text) Then
      MsgBox "请选择年级!", 48, "提示"
      Text1(2).SetFocus
      Exit Sub
    End If
    '+++++++++++++++++++++++++++++++++++++++++++++++++
    txtSQL = "select * from class "
    Set dream = ExecuteSQL(txtSQL, Msgtext)
    dream.MoveFirst
    While (dream.EOF = False)
       If (dream.Fields(0)) = Trim(Text1(0).Text) Then
         MsgBox "班号已经存在!", 48, "提示"
         Text1(0).Text = " "
         Text1(0).SetFocus
         Exit Sub
       Else
         dream.MoveNext
      End If
    Wend
    dream.AddNew
    dream.Fields(0) = Trim(Text1(0).Text)
    dream.Fields(1) = Trim(Text1(1).Text)
    dream.Fields(2) = Trim(Text1(2).Text)
    dream.Fields(3) = Trim(Text1(3).Text)
    dream.UpdateBatch
    '=================================================
    MsgBox "添加班级成功!", 48, "提示"
    Command1.Enabled = True
    Command2.Enabled = True
    Command3.Enabled = True
    For i = 0 To 3
      Text1(i).Text = ""
    Next i
 Else
    For i = 0 To 3
      Text1(i).Text = ""
    Next i
End If
End Sub

Private Sub Command2_Click()
    For i = 0 To 3
      Text1(i).Text = ""
    Next i
End Sub

Private Sub Command3_Click()
 studentmdi.StatusBar1.Panels.Item(1).Text = " "
 Unload Me
End Sub




Private Sub Form_Activate()
Text1(0).SetFocus
End Sub

Private Sub Form_Load()
addclass.Height = 5535
addclass.Width = 8805
addclass.Caption = "添加班级信息[" + Format(Date, "yyyy年mm月dd日]")
studentmdi.StatusBar1.Panels.Item(1).Text = "添加班级信息"
End Sub

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
'set setfocus
If KeyAscii = 13 Then
    i = (Index + 1) Mod 4
    Text1(i).SetFocus
End If
End Sub

⌨️ 快捷键说明

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