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

📄 chaxunji.frm

📁 一个简单的VB开发环境的学生管理系统.请各位大虾们多多指教
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      End
      Begin VB.Label Label16 
         Caption         =   "班级:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   375
         Left            =   7800
         TabIndex        =   35
         Top             =   1560
         Width           =   975
      End
      Begin VB.Label Label15 
         Caption         =   "出生日期:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   495
         Left            =   3960
         TabIndex        =   34
         Top             =   1560
         Width           =   1575
      End
      Begin VB.Label Label14 
         Caption         =   "专业:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   375
         Left            =   960
         TabIndex        =   33
         Top             =   2640
         Width           =   1215
      End
      Begin VB.Label Label13 
         Caption         =   "所处系部:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   375
         Left            =   3840
         TabIndex        =   32
         Top             =   2640
         Width           =   1575
      End
      Begin VB.Label Label12 
         Caption         =   "生源地:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   495
         Left            =   7440
         TabIndex        =   31
         Top             =   2520
         Width           =   2055
      End
      Begin VB.Label Label11 
         Caption         =   "籍贯:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   495
         Left            =   960
         TabIndex        =   30
         Top             =   3360
         Width           =   1215
      End
      Begin VB.Label Label10 
         Caption         =   "学号:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   15.75
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   495
         Left            =   960
         TabIndex        =   29
         Top             =   1560
         Width           =   1215
      End
      Begin VB.Label Label4 
         Height          =   375
         Left            =   120
         TabIndex        =   28
         Top             =   360
         Width           =   1575
      End
   End
End
Attribute VB_Name = "chaxunji"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public rs As ADODB.Recordset

Private Sub Form_Load()
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 学籍表 order by 学号"
Adodc1.Refresh
Set rs = Adodc1.Recordset
End Sub

Private Sub Labelcha_Click()
Dim r As String
If Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 0 Then
                 If Trim(txtnumber) = "" Or Not IsNumeric(txtnumber) Then
                     r = MsgBox("查询学号为空,或有非法字符,请从新输入!", vbOKCancel + vbExclamation, "警告")
                       If r = vbOK Then
                               txtnumber = "": txtnumber.SetFocus
                       Else
                          txtnumber = "": Exit Sub
                          End If
                Else
                    Adodc1.RecordSource = "select * from 学籍表 where 学号='" & txtnumber & "'"
                    Adodc1.Refresh
                End If
               MsgBox "没有你要查询的学籍!"
               txtnumber = "": txtnumber.SetFocus: Exit Sub
End If
 If Check1.Value = 0 And Check2.Value = 1 And Check3.Value = 0 Then

                If Trim(txtname) = "" Then
                     r = MsgBox("查询姓名为空,请从新输入!", vbOKCancel + vbExclamation, "警告")
                       If r = vbOK Then
                               txtname = "": txtname.SetFocus
                       Else
                          txtname = "": Exit Sub
                          End If
                Else
                    Adodc1.RecordSource = "select * from 学籍表 where 姓名='" & txtname & "'"
                    Adodc1.Refresh
                End If
             MsgBox "没有你要查询的学籍!"
             txtname = "": txtname.SetFocus: Exit Sub
End If
If Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 1 Then
                 If Trim(txtsex) = "" Then
                     r = MsgBox("查询性别为空,请从新输入!", vbOKCancel + vbExclamation, "警告")
                       If r = vbOK Then
                               txtsex = "": txtsex.SetFocus
                       Else
                          txtsex = "": Exit Sub
                          End If
                Else
                    Adodc1.RecordSource = "select * from 学籍表 where 性别='" & txtsex & "'"
                    Adodc1.Refresh
                End If
         MsgBox "没有你要查询的学籍!"
         txtsex = "": txtsex.SetFocus
End If
If Check1.Value = 1 And Check2.Value = 1 And Check3.Value = 0 Then
                 If Trim(txtnumber) = "" Or Not IsNumeric(txtnumber) Or Trim(txtname) = "" Then
                     r = MsgBox("查询学号,姓名为空,或学号有非法字符,请从新输入!", vbOKCancel + vbExclamation, "警告")
                       If r = vbOK Then
                               txtnumber = "": txtnumber.SetFocus
                       Else
                          txtnumber = "": Exit Sub
                          End If
                Else
                    Adodc1.RecordSource = "select * from 学籍表 where 学号='" & txtnumber & "'and 姓名='" & txtname & "'"
                    Adodc1.Refresh
                End If
   MsgBox "没有你要查询的学籍!"
   txtnumber = "": txtname = "": txtnumber.SetFocus: Exit Sub
 End If
If Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 1 Then
                 If Trim(txtname) = "" Or Trim(txtsex) = "" Then
                     r = MsgBox("查询姓名或性别为空,请从新输入!", vbOKCancel + vbExclamation, "警告")
                       If r = vbOK Then
                               txtname = "": txtname.SetFocus
                       Else
                          txtname = "": Exit Sub
                          End If
                Else
                    Adodc1.RecordSource = "select * from 学籍表 where 姓名='" & txtname & "' and  性别='" & txtsex & "'"
                    Adodc1.Refresh
                End If
        MsgBox "没有你要查询的学籍!"
        txtsex = "": txtname = "": txtname.SetFocus: Exit Sub
End If
If Check1.Value = 0 And Check2.Value = 1 And Check3.Value = 1 Then
                 If Trim(txtnumber) = "" Or Not IsNumeric(txtnumber) Or Trim(txtsex) = "" Then
                     r = MsgBox("查询学号或 性别为空,或学号有非法字符,请从新输入!", vbOKCancel + vbExclamation, "警告")
                       If r = vbOK Then
                               txtnumber = "": txtnumber.SetFocus
                       Else
                          txtnumber = "": Exit Sub
                          End If
                Else
                    Adodc1.RecordSource = "select * from 学籍表 where 学号='" & txtnumber & "'and 性别='" & txtsex & "' "
                    Adodc1.Refresh
                End If
        MsgBox "没有你要查询的学籍!"
        txtnumber = "": txtsex = "": txtnumber.SetFocus: Exit Sub
End If
If Check1.Value = 1 And Check2.Value = 1 And Check3.Value = 1 Then
                 If Trim(txtnumber) = "" Or Not IsNumeric(txtnumber) Or Trim(txtsex) = "" Or Trim(txtname) = "" Then
                     r = MsgBox("查询学号或 性别,姓名为空,或学号有非法字符,请从新输入!", vbOKCancel + vbExclamation, "警告")
                       If r = vbOK Then
                               txtnumber = "": txtnumber.SetFocus
                       Else
                          txtnumber = "": Exit Sub
                          End If
                Else
                    Adodc1.RecordSource = "select * from 学籍表 where 学号='" & txtnumber & "'and 性别='" & txtsex & "' and 姓名='" & txtname & "' "
                    Adodc1.Refresh
                End If
End If
  MsgBox "没有你要查询的信息": txtnumber.SetFocus: Exit Sub
End Sub

Private Sub Labelexit_Click()
Unload Me
MDIFrm.Show
End Sub

Private Sub Labelfirst_Click()
rs.MoveFirst
MsgBox "当前第一条记录!"
End Sub

Private Sub Labellast_Click()
rs.MoveLast
MsgBox "当前最后一条记录!"
Exit Sub
End Sub

Private Sub Labelnext_Click()
With rs
If .AbsolutePosition = adPosEOF Then
.MoveLast
MsgBox "已经是当前最后一条记录!"
Else: .MoveNext
Exit Sub
End If
End With
End Sub

Private Sub Labelprevious_Click()
With rs
.MovePrevious
If .AbsolutePosition = adPosBOF Then
rs.MoveFirst
MsgBox "已经是当前第一条记录!"
Exit Sub
End If
End With
End Sub

⌨️ 快捷键说明

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