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

📄 form1.frm

📁 模拟文件管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   BackColor       =   &H00C0FFC0&
   Caption         =   "学生档案查询表"
   ClientHeight    =   5175
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8520
   LinkTopic       =   "Form1"
   ScaleHeight     =   5175
   ScaleWidth      =   8520
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Command1 
      Caption         =   "返  回"
      Height          =   375
      Left            =   6120
      Picture         =   "Form1.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   22
      ToolTipText     =   "您可以返回首页"
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton cmdquit 
      Caption         =   "退  出"
      Height          =   375
      Index           =   0
      Left            =   7200
      Picture         =   "Form1.frx":09E2
      Style           =   1  'Graphical
      TabIndex        =   21
      ToolTipText     =   "您可以退出本程序"
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton cmdfindnext 
      Caption         =   "下一个"
      Height          =   375
      Left            =   5040
      Picture         =   "Form1.frx":2F20
      Style           =   1  'Graphical
      TabIndex        =   20
      ToolTipText     =   "继续查找记录"
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton cmdfind 
      Caption         =   "查  找"
      Height          =   375
      Left            =   3840
      Picture         =   "Form1.frx":13054
      Style           =   1  'Graphical
      TabIndex        =   19
      ToolTipText     =   "查找您想要的记录"
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton cmdfresh 
      Caption         =   "更  新"
      Height          =   375
      Left            =   2640
      Picture         =   "Form1.frx":19836
      Style           =   1  'Graphical
      TabIndex        =   18
      ToolTipText     =   "更新您的记录"
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton cmddel 
      Caption         =   "删  除"
      Height          =   375
      Left            =   1440
      Picture         =   "Form1.frx":1DBFA
      Style           =   1  'Graphical
      TabIndex        =   17
      ToolTipText     =   "删除记录"
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton cmdadd 
      Caption         =   "添  加"
      Height          =   375
      Left            =   240
      Picture         =   "Form1.frx":2DD2E
      Style           =   1  'Graphical
      TabIndex        =   16
      ToolTipText     =   "您可以添加新记录"
      Top             =   4080
      Width           =   855
   End
   Begin VB.Data Data1 
      Caption         =   "学生档案查询"
      Connect         =   "Access"
      DatabaseName    =   "C:\Documents and Settings\yyj\My Documents\李立文件管理\学生档案查询库.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      EOFAction       =   2  'Add New
      Exclusive       =   0   'False
      Height          =   375
      Left            =   120
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "学生档案查询库"
      Top             =   3240
      Width           =   7095
   End
   Begin VB.TextBox Text6 
      DataField       =   "联系电话"
      DataSource      =   "Data1"
      Height          =   375
      Left            =   1320
      TabIndex        =   15
      Top             =   2520
      Width           =   3495
   End
   Begin VB.TextBox Text5 
      DataField       =   "家庭住址"
      DataSource      =   "Data1"
      Height          =   375
      Left            =   1320
      TabIndex        =   13
      Top             =   1800
      Width           =   3495
   End
   Begin VB.ComboBox com2 
      DataField       =   "政治面貌"
      DataSource      =   "Data1"
      Height          =   300
      Left            =   6120
      TabIndex        =   11
      Top             =   1080
      Width           =   1095
   End
   Begin VB.TextBox Text4 
      DataField       =   "出生日期"
      DataSource      =   "Data1"
      Height          =   375
      Left            =   3720
      TabIndex        =   9
      Top             =   1080
      Width           =   975
   End
   Begin VB.TextBox Text3 
      DataField       =   "籍贯"
      DataSource      =   "Data1"
      Height          =   375
      Left            =   1320
      TabIndex        =   7
      Top             =   1080
      Width           =   975
   End
   Begin VB.ComboBox com1 
      DataField       =   "性别"
      DataSource      =   "Data1"
      Height          =   300
      Left            =   6120
      TabIndex        =   5
      Top             =   360
      Width           =   1095
   End
   Begin VB.TextBox Text2 
      DataField       =   "姓名"
      DataSource      =   "Data1"
      Height          =   375
      Left            =   3720
      TabIndex        =   3
      Top             =   360
      Width           =   975
   End
   Begin VB.TextBox Text1 
      DataField       =   "编号"
      DataSource      =   "Data1"
      Height          =   375
      Left            =   1320
      TabIndex        =   1
      Top             =   360
      Width           =   975
   End
   Begin VB.Label Label8 
      BackStyle       =   0  'Transparent
      Caption         =   "联系电话:"
      Height          =   375
      Left            =   120
      TabIndex        =   14
      Top             =   2520
      Width           =   1095
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "家庭住址:"
      Height          =   375
      Left            =   120
      TabIndex        =   12
      Top             =   1800
      Width           =   1095
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "政治面貌:"
      Height          =   375
      Left            =   5040
      TabIndex        =   10
      Top             =   1080
      Width           =   975
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "出生日期:"
      Height          =   375
      Left            =   2640
      TabIndex        =   8
      Top             =   1080
      Width           =   975
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "籍   贯:"
      Height          =   375
      Left            =   240
      TabIndex        =   6
      Top             =   1080
      Width           =   855
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "性   别:"
      Height          =   375
      Left            =   5160
      TabIndex        =   4
      Top             =   360
      Width           =   855
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "姓   名:"
      Height          =   375
      Left            =   2760
      TabIndex        =   2
      Top             =   360
      Width           =   855
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "编   号:"
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   855
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public findstring  As String
Private Sub cmdadd_Click()
cmdadd.Enabled = False
cmddel.Enabled = False
cmdfresh.Enabled = True
Data1.Recordset.AddNew
Text1.SetFocus
cmdfresh.Enabled = True

End Sub

Private Sub cmddel_Click()

If Data1.Recordset.EOF = True Then
  MsgBox "这已是最后一条记录"
  Else
  Data1.Recordset.Delete
  If Data1.Recordset.EOF = True Then
  Data1.Recordset.MoveFirst
  Else
  Data1.Recordset.MoveNext
  End If
  End If
  Data1.Refresh
End Sub

Private Sub cmdEnd_Click()
End
End Sub
Private Sub cmdfind_Click()
cmdfindnext.Enabled = True
Dim temp As String
temp = InputBox$("请输入查询的姓名")
temp = Trim(temp) '去掉字符串首尾的空格
findstring = "姓名=" + "'" + temp + "'"
Data1.Recordset.FindFirst findstring
If Data1.Recordset.NoMatch Then
 MsgBox "姓名为" + temp + "的记录没有找到"
 End If
 
End Sub

Private Sub cmdfindnext_Click()

Data1.Recordset.FindNext findstring
If Data1.Recordset.NoMatch Then
MsgBox "指定的记录已找完"
End If
cmdfindnext.Enabled = False
End Sub

Private Sub cmdfresh_Click()
Data1.UpdateRecord
Data1.Recordset.Bookmark = Data1.Recordset.LastModified
cmdadd.Enabled = True
cmddel.Enabled = True
cmdfresh.Enabled = False
End Sub

Private Sub cmdquit_Click(Index As Integer)
End
End Sub

Private Sub Command1_Click()
Form2.Hide
Form1.Show
End Sub

Private Sub Form_Load()
com1.AddItem "男"
com1.AddItem "女"
com2.AddItem "党员"
com2.AddItem "团员"
com2.AddItem "群众"
cmdfresh.Enabled = False
cmdfindnext.Enabled = False
End Sub

⌨️ 快捷键说明

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