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

📄 modleague.frm

📁 简单的数据库系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   5280
         TabIndex        =   26
         Top             =   840
         Width           =   1215
      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          =   495
         Left            =   5280
         TabIndex        =   25
         Top             =   1560
         Width           =   1215
      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            =   5280
         TabIndex        =   24
         Top             =   2160
         Width           =   1215
      End
      Begin VB.Label Label8 
         Caption         =   "入团日期"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   5280
         TabIndex        =   23
         Top             =   2760
         Width           =   975
      End
      Begin VB.Label Label11 
         Caption         =   "输入查询条件"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   22
         Top             =   360
         Width           =   1455
      End
   End
   Begin VB.CommandButton Command10 
      Caption         =   "关闭(&C)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   10200
      TabIndex        =   6
      Top             =   3360
      Width           =   1215
   End
   Begin VB.CommandButton Command9 
      Caption         =   " 取消(&E) "
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   10200
      TabIndex        =   5
      Top             =   2760
      Width           =   1215
   End
   Begin VB.CommandButton Command8 
      Caption         =   "查询(&Q)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   10200
      TabIndex        =   4
      Top             =   2160
      Width           =   1215
   End
   Begin VB.CommandButton Command7 
      Caption         =   "更新(&R)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   10200
      TabIndex        =   3
      Top             =   1560
      Width           =   1215
   End
   Begin VB.CommandButton Command6 
      Caption         =   "删除(&D)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   10200
      TabIndex        =   2
      Top             =   960
      Width           =   1215
   End
   Begin VB.CommandButton Command5 
      Caption         =   "编辑(&M)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   10200
      TabIndex        =   1
      Top             =   360
      Width           =   1215
   End
   Begin VB.Frame Frame2 
      Height          =   4095
      Left            =   9960
      TabIndex        =   0
      Top             =   120
      Width           =   1695
   End
End
Attribute VB_Name = "modleague"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mybookmark As Variant
Private Sub Command1_Click()
  Command2.Enabled = True
  Command3.Enabled = False
  dream.MoveFirst '移动到数据集的第一条记录
  Call viewdata '调用显示数据的函数
  MsgBox "这是条一条记录!", 48, "注意!"
End Sub
Private Sub Command10_Click()
studentmdi.StatusBar1.Panels.Item(1).Text = "修改团员信息"
Unload Me
End Sub



Private Sub Command11_Click()
If Command11.Caption = "搜索(&S)" Then
    If Not Testtxt(Text9.Text) Then
       MsgBox "请输入学号!", 48, "提示"
       Text9.Text = ""
       'Text9.SetFocus
    Else
       txtSQL = "select * from league where 编号  like '%" & Text9.Text & "' OR 姓名 like '" & Text9.Text & "'"
       Set dream = ExecuteSQL(txtSQL, Msgtext)
       Call viewdata
    End If
End If
End Sub

Private Sub Command2_Click()
 Command3.Enabled = True
 dream.MoveNext  '数据集向后移动一条记录
 If dream.EOF Then '判断是否终止位置
   dream.MoveFirst
 End If
 Call viewdata
End Sub

Private Sub Command3_Click()
    Command2.Enabled = True
    dream.MovePrevious '数据集向前移动一条记录
    If dream.BOF Then  '判断是否到起始位置
        dream.MoveLast
    End If
    Call viewdata
End Sub

Private Sub Command4_Click()
   Command3.Enabled = True
   Command2.Enabled = False
   dream.MoveLast '移动到数据集的最后一条记录
    Call viewdata
    MsgBox "这是最后一条记录!", 48, "注意!"
End Sub


Private Sub Command5_Click()
If Command5.Caption = "编辑(&M)" Then
    Text1.Enabled = True
    Text2.Enabled = True
    Text3.Enabled = True
    Text4.Enabled = True
    Text5.Enabled = True
    Text6.Enabled = True
    Text7.Enabled = True
    Text8.Enabled = True
    Combo1.Enabled = True
    Combo2.Enabled = True
    Command1.Enabled = True
    Command2.Enabled = True
    Command3.Enabled = True
    Command4.Enabled = True
    mybookmark = dream.Bookmark  '记下当前记录位置
    End If
End Sub

Private Sub Command6_Click()
 mybookmark = dream.Bookmark
    str2$ = MsgBox("是否删除当前记录?", vbOKCancel, "删除当前记录")
    If str2$ = vbOK Then
            dream.MoveNext
            If dream.EOF Then   'recordset is empty?
                dream.MoveFirst
                mybookmark = dream.Bookmark  'sign current position
                dream.MoveLast
                dream.Delete
                dream.Close
        
                txtSQL = "select * from league"
                Set dream = ExecuteSQL(txtSQL, Msgtext)
                dream.MoveLast
                Call viewdata
            Else
                mybookmark = dream.Bookmark 'sign current position
                dream.MovePrevious
                dream.Delete
                dream.Close
                
                txtSQL = "select * from league"
                Set dream = ExecuteSQL(txtSQL, Msgtext)
                dream.MoveLast
                Call viewdata
            End If
    Else
        dream.Bookmark = mybookmark 'return primary position
        Call viewdata
    End If
End Sub

Private Sub Command7_Click()
    Command1.Enabled = False
    Command2.Enabled = False
    Command3.Enabled = False
    Command4.Enabled = False
    
    If dream.EOF = False Then
      
       MsgBox "真的要更新吗?", vbOKCancel + vbExclamation, "警告"
              'record current position
              dream.Bookmark = mybookmark  'return to current modifty position
              dream.Delete
              
             txtSQL = "select * from league  "
             Set dream = ExecuteSQL(txtSQL, Msgtext)
    
             dream.Bookmark = mybookmark  'return to current modifty position
    
             dream.AddNew
    dream.Fields(0) = Trim(Text1.Text)
    dream.Fields(1) = Trim(Text2.Text)
    dream.Fields(2) = Trim(Combo1.Text)
    dream.Fields(3) = Trim(Combo2.Text)
    dream.Fields(4) = Trim(Text3.Text)
    dream.Fields(5) = Trim(Text4.Text)
    dream.Fields(6) = Trim(Text5.Text)
    dream.Fields(7) = Trim(Text6.Text)
    dream.Fields(8) = Trim(Text7.Text)
    dream.Fields(9) = Trim(Text8.Text)
    dream.Update
    dream.Close
    MsgBox "修改团员信息成功!", vbQuestion + vbOKOnly, "提示!"
   End If
End Sub

Private Sub Command9_Click()
     dream.Bookmark = mybookmark
     Call viewdata
End Sub

Private Sub Form_Unload(Cancel As Integer)
    gintPmode = 0
End Sub
Private Sub Text13_GotFocus()
     highlight
     With Screen.ActiveForm
        If (TypeOf .ActiveControl Is TextBox) Then
       .ActiveControl.SelStart = 0
       .ActiveControl.SelLength = Len(.ActiveControl)
        End If
     End With
End Sub
Public Sub highlight()
   With Screen.ActiveForm
    If (TypeOf .ActiveControl Is TextBox) Then
      .ActiveControl.SelStart = 0
      .ActiveControl.SelLength = Len(.ActiveControl)
    End If
   End With
End Sub
Private Sub Form_Load()
   modleague.Height = 8940
   modleague.Width = 11940
   Combo1.AddItem "男"
   Combo1.AddItem "女"
   Combo2.AddItem "汉族"
   Combo2.AddItem "回族"
   '========================================================
    txtSQL = "select * from league "
    Set dream = ExecuteSQL(txtSQL, Msgtext)  'excute query opertion
       
       If dream.EOF = False Then
          dream.MoveFirst   'move first
          Call viewdata     'display records
          mybookmark = dream.Bookmark
       Else
         MsgBox "没有此记录!", vbOKOnly + vbExclamation, "警告"
         Exit Sub
       End If
    
    mcbookmark = dream.Bookmark '记下当前记录的位置
    Text1.Enabled = False
    Text2.Enabled = False
    Combo1.Enabled = False
    Combo2.Enabled = False
    Text3.Enabled = False
    Text4.Enabled = False
    Text5.Enabled = False
    Text6.Enabled = False
    Text7.Enabled = False
    Text8.Enabled = False
    Text9.Enabled = False
    modleague.Caption = "修改团员信息[" + Format(Date, "yyyy年mm月dd日]")
    studentmdi.StatusBar1.Panels.Item(1).Text = "修改团员信息"
End Sub

Public Sub viewdata()       '由于程序中各处需要显示数据,定义函数ViewData
    Text1.Text = dream.Fields(0)
    Text2.Text = dream.Fields(1)
    Combo1.Text = dream.Fields(2)
    Combo2.Text = dream.Fields(3)
    Text3.Text = dream.Fields(4)
    Text4.Text = dream.Fields(5)
    Text5.Text = dream.Fields(6)
    Text6.Text = dream.Fields(7)
    Text7.Text = dream.Fields(8)
    Text8.Text = dream.Fields(9)
End Sub
Private Sub Text13_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
     Call Command12_Click
  End If
End Sub

⌨️ 快捷键说明

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