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

📄 信息修改.frm

📁 房屋分配一个小程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Frm_Edit 
   Caption         =   "信息修改"
   ClientHeight    =   3915
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6375
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3915
   ScaleWidth      =   6375
   StartUpPosition =   2  '屏幕中心
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   3720
      TabIndex        =   17
      Top             =   1200
      Width           =   1815
   End
   Begin VB.TextBox Text8 
      Appearance      =   0  'Flat
      Height          =   495
      Left            =   3480
      TabIndex        =   16
      Text            =   "Text8"
      Top             =   4080
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.TextBox Text7 
      Appearance      =   0  'Flat
      Height          =   375
      Left            =   3720
      TabIndex        =   15
      Text            =   "Text7"
      Top             =   1920
      Width           =   1815
   End
   Begin VB.TextBox Text5 
      Appearance      =   0  'Flat
      Height          =   375
      Left            =   3720
      TabIndex        =   12
      Text            =   "Text5"
      Top             =   480
      Width           =   1815
   End
   Begin VB.TextBox Text2 
      Appearance      =   0  'Flat
      Height          =   375
      Left            =   1080
      TabIndex        =   6
      Text            =   "Text2"
      Top             =   1080
      Width           =   1335
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      Height          =   375
      Left            =   1080
      TabIndex        =   4
      Text            =   "Text1"
      Top             =   480
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   495
      Left            =   4920
      TabIndex        =   2
      Top             =   3240
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   495
      Left            =   3360
      TabIndex        =   1
      Top             =   3240
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Caption         =   "人员信息"
      Height          =   2895
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   6015
      Begin VB.TextBox Text4 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   960
         TabIndex        =   10
         Text            =   "Text4"
         Top             =   2160
         Width           =   1335
      End
      Begin VB.TextBox Text3 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   960
         TabIndex        =   8
         Text            =   "Text3"
         Top             =   1560
         Width           =   1335
      End
      Begin VB.Label Label7 
         Caption         =   "政治面貌:"
         Height          =   255
         Left            =   2520
         TabIndex        =   14
         Top             =   1800
         Width           =   975
      End
      Begin VB.Label Label6 
         Caption         =   "职务:"
         Height          =   255
         Left            =   2880
         TabIndex        =   13
         Top             =   1080
         Width           =   735
      End
      Begin VB.Label Label5 
         Caption         =   "工龄:"
         Height          =   375
         Left            =   2880
         TabIndex        =   11
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   "年龄:"
         Height          =   255
         Left            =   360
         TabIndex        =   9
         Top             =   2160
         Width           =   495
      End
      Begin VB.Label Label3 
         Caption         =   "性别:"
         Height          =   375
         Left            =   360
         TabIndex        =   7
         Top             =   1560
         Width           =   615
      End
      Begin VB.Label Label2 
         Caption         =   "姓名:"
         Height          =   255
         Left            =   360
         TabIndex        =   5
         Top             =   960
         Width           =   615
      End
      Begin VB.Label Label1 
         Caption         =   "ID:"
         Height          =   255
         Left            =   480
         TabIndex        =   3
         Top             =   360
         Width           =   735
      End
   End
End
Attribute VB_Name = "Frm_Edit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database
Dim rs As Recordset
Private Sub Command1_Click()
Dim Num As Integer
Num = Text8.Text
db.Execute "delete * from 人员信息表 where 编号=" & Num & " "
If Text1.Text <> "" Then
rs.AddNew
rs("ID") = Text1.Text
rs("姓名") = Text2.Text
rs("性别") = Text3.Text
rs("年龄") = Text4.Text
rs("工龄") = Text5.Text
rs("职务") = Combo1.Text
rs("政治面貌") = Text7.Text
rs.Update
MsgBox ("修改成功!")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Combo1.Text = ""
Text7.Text = ""
Else
MsgBox ("记录不允许为空!")
End If
End Sub

Private Sub Command2_Click()
Unload Me
Frm_Main.Show

End Sub

Private Sub Form_Load()
Set db = OpenDatabase(App.Path & "\sjk1.mdb")
Set rs = db.OpenRecordset("人员信息表")
Combo1.AddItem "局级"
Combo1.AddItem "副局级"
Combo1.AddItem "处级"
Combo1.AddItem "副处级"
Combo1.AddItem "科级"
Combo1.AddItem "副科级"
Combo1.AddItem "科员"
End Sub


⌨️ 快捷键说明

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