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

📄 frmedit.frm

📁 用VB实现的小型信息系统课程设计,希望对大家有帮助
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmEdit 
   Caption         =   "修改记录"
   ClientHeight    =   5700
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6660
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   5700
   ScaleWidth      =   6660
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command3 
      Caption         =   "取消"
      Height          =   375
      Left            =   3960
      TabIndex        =   17
      Top             =   4920
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "保存"
      Height          =   375
      Left            =   2640
      TabIndex        =   16
      Top             =   4920
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修改"
      Height          =   375
      Left            =   1320
      TabIndex        =   15
      Top             =   4920
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1320
      TabIndex        =   6
      Text            =   "Text1"
      Top             =   960
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1320
      TabIndex        =   5
      Text            =   "Text1"
      Top             =   1680
      Width           =   1215
   End
   Begin VB.TextBox Text3 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1320
      TabIndex        =   4
      Text            =   "Text1"
      Top             =   2400
      Width           =   1215
   End
   Begin VB.TextBox Text4 
      Enabled         =   0   'False
      Height          =   375
      Left            =   4800
      TabIndex        =   3
      Text            =   "Text1"
      Top             =   2400
      Width           =   1215
   End
   Begin VB.TextBox Text5 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1320
      TabIndex        =   2
      Text            =   "Text1"
      Top             =   3120
      Width           =   1935
   End
   Begin VB.TextBox Text6 
      Enabled         =   0   'False
      Height          =   375
      Left            =   4800
      TabIndex        =   1
      Text            =   "Text1"
      Top             =   960
      Width           =   1215
   End
   Begin VB.TextBox Text7 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1320
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   3840
      Width           =   3975
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "修改记录"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   315
      Left            =   2520
      TabIndex        =   14
      Top             =   360
      Width           =   1320
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "编号:"
      Height          =   180
      Left            =   600
      TabIndex        =   13
      Top             =   960
      Width           =   540
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "姓名:"
      Height          =   180
      Left            =   600
      TabIndex        =   12
      Top             =   1680
      Width           =   540
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "年龄:"
      Height          =   180
      Left            =   600
      TabIndex        =   11
      Top             =   2400
      Width           =   540
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "性别:"
      Height          =   180
      Left            =   4080
      TabIndex        =   10
      Top             =   2400
      Width           =   540
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "电话:"
      Height          =   180
      Left            =   600
      TabIndex        =   9
      Top             =   3120
      Width           =   540
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "所属社团号:"
      Height          =   180
      Left            =   3600
      TabIndex        =   8
      Top             =   960
      Width           =   1080
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      Caption         =   "身份证:"
      Height          =   180
      Left            =   480
      TabIndex        =   7
      Top             =   3840
      Width           =   720
   End
End
Attribute VB_Name = "frmEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
  frmMain.Data1.Recordset.Edit
  
  Me.Text1.Enabled = True
  Me.Text2.Enabled = True
  Me.Text3.Enabled = True
  Me.Text4.Enabled = True
  Me.Text5.Enabled = True
  Me.Text6.Enabled = True
  Me.Text7.Enabled = True
  Me.Command1.Enabled = False
End Sub

Private Sub Command2_Click()
  frmMain.Data1.Recordset.Edit
  frmMain.Data1.Recordset.Fields("Id").Value = Me.Text1.Text
  frmMain.Data1.Recordset.Fields("Name").Value = Me.Text2.Text
  frmMain.Data1.Recordset.Fields("age").Value = Me.Text3.Text
  frmMain.Data1.Recordset.Fields("Sex").Value = Me.Text4.Text
  frmMain.Data1.Recordset.Fields("Phone").Value = Me.Text5.Text
  frmMain.Data1.Recordset.Fields("suoshu").Value = Me.Text6.Text
  frmMain.Data1.Recordset.Fields("shenfen").Value = Me.Text7.Text
  frmMain.Data1.Recordset.Update
  
  Me.Command2.Enabled = False
  MsgBox "修改记录成功!!!", vbOKOnly + vbInformation, "提示..."
  frmMain.Data1.Refresh
  
  Unload Me
End Sub

Private Sub Command3_Click()
  Unload Me
End Sub

Private Sub Form_Load()
  Me.Text1.Text = frmMain.Data1.Recordset.Fields("Id").Value
  Me.Text2.Text = frmMain.Data1.Recordset.Fields("Name").Value
  Me.Text3.Text = frmMain.Data1.Recordset.Fields("age").Value
  Me.Text4.Text = frmMain.Data1.Recordset.Fields("Sex").Value
  Me.Text5.Text = frmMain.Data1.Recordset.Fields("Phone").Value
  Me.Text6.Text = frmMain.Data1.Recordset.Fields("suoshu").Value
  Me.Text7.Text = frmMain.Data1.Recordset.Fields("shenfen").Value
End Sub


⌨️ 快捷键说明

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