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

📄 modstudgood.frm

📁 简单的数据库系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   720
         TabIndex        =   4
         Top             =   360
         Width           =   615
      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          =   375
         Index           =   0
         Left            =   2280
         TabIndex        =   3
         Top             =   390
         Width           =   855
      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          =   375
         Index           =   0
         Left            =   4200
         TabIndex        =   2
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Label9 
         Caption         =   "校级"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   6000
         TabIndex        =   1
         Top             =   360
         Width           =   615
      End
   End
   Begin VB.Label Label14 
      Caption         =   "请输入学号查询"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   39
      Top             =   240
      Width           =   1695
   End
   Begin VB.Label Label13 
      Caption         =   "     照  片"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   9600
      TabIndex        =   25
      Top             =   2520
      Width           =   1455
   End
   Begin VB.Label Label5 
      Caption         =   "班级"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   0
      Left            =   360
      TabIndex        =   11
      Top             =   2040
      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
      Index           =   0
      Left            =   4560
      TabIndex        =   10
      Top             =   1440
      Width           =   735
   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            =   360
      TabIndex        =   9
      Top             =   1440
      Width           =   615
   End
   Begin VB.Label Label2 
      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            =   4560
      TabIndex        =   8
      Top             =   840
      Width           =   735
   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          =   375
      Index           =   0
      Left            =   360
      TabIndex        =   7
      Top             =   840
      Width           =   615
   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          =   1335
      Index           =   0
      Left            =   480
      TabIndex        =   6
      Top             =   4440
      Width           =   375
   End
   Begin VB.Label Label12 
      Caption         =   "日期"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   0
      Left            =   4560
      TabIndex        =   5
      Top             =   2040
      Width           =   735
   End
End
Attribute VB_Name = "modstudgood"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mybookmark As Variant

'Dim mybookmark As BookmarkEnum
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 Command2_Click()
 Command3.Enabled = True
 dream.MoveNext  '数据集向后移动一条记录
 If dream.EOF Then '判断是否终止位置
   dream.MoveFirst
 End If
 Call viewdata
End Sub

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

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

Private Sub Command12_Click()
If Command12.Caption = "搜索(&Q)" Then
   If Not Testtxt(Text7.Text) Then
      MsgBox "请输入学号!", 48, "提示"
      Text7.SetFocus
      Exit Sub
    End If
     txtSQL = "select * from studgood where  学号 like '%" & Text7.Text & "'OR 姓名 like '" & Text7.Text & "'"
     Set dream = ExecuteSQL(txtSQL, Msgtext)
     Call viewdata
End If
End Sub

Private Sub Command5_Click()
If Command5.Caption = "编辑(&M)" Then
    Text1.Enabled = True
    Text2.Enabled = True
    Combo1.Enabled = True
    Combo2.Enabled = True
    Combo3.Enabled = True
    Combo4.Enabled = True
    Combo6.Enabled = True
    Text3.Enabled = True
    Text4.Enabled = True
    Text5.Enabled = True
    Text6.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 studgood"
                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 studgood"
                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 studgood  "
              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(Text3.Text)
    dream.Fields(3) = Trim(Combo6.Text)
    dream.Fields(4) = Trim(Text4.Text)
    dream.Fields(5) = Trim(Text5.Text)
    dream.Fields(6) = Trim(Combo1.Text)
    dream.Fields(7) = Trim(Combo2.Text)
    dream.Fields(8) = Trim(Combo3.Text)
    dream.Fields(9) = Trim(Combo4.Text)
    dream.Fields(10) = Trim(Text6.Text)
    dream.Update
    dream.Close
  End If
End Sub

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

'=============================================================
Private Sub Form_Load()
   Combo6.AddItem "男"
   Combo6.AddItem "女"
   Combo1.AddItem "三好生"
   Combo1.AddItem "学生干部"
   Combo1.AddItem "优秀团员"
   Combo2.AddItem "三好生"
   Combo2.AddItem "学生干部"
   Combo2.AddItem "优秀团员"
   Combo3.AddItem "三好生"
   Combo3.AddItem "学生干部"
   Combo3.AddItem "优秀团员"
   Combo4.AddItem "三好生"
   Combo4.AddItem "学生干部"
   Combo4.AddItem "优秀团员"
      txtSQL = "select * from studgood "
       Set dream = ExecuteSQL(txtSQL, Msgtext) '执行查询操作
       dream.MoveFirst   '移到第一条记录
       Call viewdata     '显示记录
       mcbookmark = dream.Bookmark '记下当前记录的位置
       Text1.Enabled = False
       Text2.Enabled = False
       Combo1.Enabled = False
       Combo2.Enabled = False
       Combo3.Enabled = False
       Combo4.Enabled = False
       Combo6.Enabled = False
       Text3.Enabled = False
       Text4.Enabled = False
       Text5.Enabled = False
       Text6.Enabled = False
       modstudgood.Caption = "修改学生奖励....[" + Format(Date, "yyyy年mm月dd日") + Format(Time, "hh点mm分ss秒]")
       studentmdi.StatusBar1.Panels.Item(1).Text = "修改学生奖励信息"
 End Sub
Public Sub viewdata()       '由于程序中各处需要显示数据,定义函数ViewData
    Text1.Text = dream.Fields(0)
    Text2.Text = dream.Fields(1)
    Text3.Text = dream.Fields(2)
    Combo6.Text = dream.Fields(3)
    Text4.Text = dream.Fields(4)
    Text5.Text = dream.Fields(5)
    Combo1.Text = dream.Fields(6)
    Combo2.Text = dream.Fields(7)
    Combo3.Text = dream.Fields(8)
    Combo4.Text = dream.Fields(9)
    Text6.Text = dream.Fields(10)
End Sub


Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Text5.SetFocus
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Text4.SetFocus
End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Text6.SetFocus
End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Text7.SetFocus
End If
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Text2.SetFocus
End If
End Sub

⌨️ 快捷键说明

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