📄 form14.frm
字号:
VERSION 5.00
Begin VB.Form Form14
BorderStyle = 0 'None
Caption = "修改职工信息"
ClientHeight = 6705
ClientLeft = 0
ClientTop = 0
ClientWidth = 8985
LinkTopic = "Form14"
ScaleHeight = 6705
ScaleWidth = 8985
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
Caption = "返回"
Height = 375
Left = 4200
TabIndex = 16
Top = 5760
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确认修改"
Height = 375
Left = 2160
TabIndex = 15
Top = 5760
Width = 1335
End
Begin VB.OptionButton Option2
Caption = "职工"
Height = 375
Left = 3960
TabIndex = 14
Top = 4800
Width = 975
End
Begin VB.OptionButton Option1
Caption = "管理员"
Height = 255
Left = 2040
TabIndex = 13
Top = 4800
Width = 1215
End
Begin VB.TextBox Text5
Height = 375
Left = 1920
TabIndex = 12
Text = "Text5"
Top = 3960
Width = 3735
End
Begin VB.TextBox Text4
Height = 495
Left = 1920
TabIndex = 11
Text = "Text4"
Top = 2760
Width = 3015
End
Begin VB.TextBox Text3
Height = 375
Left = 1920
TabIndex = 10
Text = "Text3"
Top = 2160
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Form14.frx":0000
Left = 1920
List = "Form14.frx":000A
TabIndex = 9
Text = "Combo1"
Top = 1560
Width = 1335
End
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 8
Text = "Text2"
Top = 960
Width = 2895
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 7
Text = "Text1"
Top = 360
Width = 2895
End
Begin VB.Label Label7
Caption = "权限"
Height = 255
Left = 600
TabIndex = 6
Top = 4800
Width = 855
End
Begin VB.Label Label6
Caption = "身份证号码"
Height = 255
Left = 600
TabIndex = 5
Top = 3960
Width = 1095
End
Begin VB.Label Label5
Caption = "地址"
Height = 255
Left = 600
TabIndex = 4
Top = 2880
Width = 735
End
Begin VB.Label Label4
Caption = "年龄"
Height = 255
Left = 600
TabIndex = 3
Top = 2280
Width = 735
End
Begin VB.Label Label3
Caption = "性别"
Height = 375
Left = 600
TabIndex = 2
Top = 1560
Width = 855
End
Begin VB.Label Label2
Caption = "姓名"
Height = 375
Left = 600
TabIndex = 1
Top = 840
Width = 975
End
Begin VB.Label Label1
Caption = "编号"
Height = 255
Left = 600
TabIndex = 0
Top = 360
Width = 735
End
End
Attribute VB_Name = "Form14"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text2.Text <> Form6.Label10.Caption Then
cmd.CommandText = "update xinxi0504_23_employee set employee_name='" & Trim(Text2.Text) & "' where employee_id='" & Trim(Text1.Text) & "'"
cmd.Execute
End If
If Combo1.Text <> Form6.Label11.Caption Then
cmd.CommandText = "update xinxi0504_23_employee set employee_sex='" & Trim(Combo1.Text) & "' where employee_id='" & Trim(Text1.Text) & "'"
cmd.Execute
End If
If Text3.Text <> Form6.Label12.Caption Then
cmd.CommandText = "update xinxi0504_23_employee set employee_age=" & Val(Trim(Text3.Text)) & " where employee_id='" & Trim(Text1.Text) & "'"
cmd.Execute
End If
If Text4.Text <> Form6.Label13.Caption Then
cmd.CommandText = "update xinxi0504_23_employee set employee_addr='" & Trim(Text4.Text) & "' where employee_id='" & Trim(Text1.Text) & "'"
cmd.Execute
End If
If Text5.Text <> Form6.Label14.Caption Then
cmd.CommandText = "update xinxi0504_23_employee set employee_ident='" & Trim(Text5.Text) & "' where employee_id='" & Trim(Text1.Text) & "'"
cmd.Execute
End If
If Option1.Value = True Then
cmd.CommandText = "update xinxi0504_23_employee set authority='管理员' where employee_id='" & Trim(Text1.Text) & "'"
cmd.Execute
Else
cmd.CommandText = "update xinxi0504_23_employee set authority='职工' where employee_id='" & Trim(Text1.Text) & "'"
cmd.Execute
End If
MsgBox "修改信息成功"
End Sub
Private Sub Command2_Click()
Form6.Show
Unload Form5
Unload Form7
Unload Form8
Unload Form9
Unload Form10
Unload Form13
Unload Form14
SetParent Form6.hWnd, Form4.hWnd
End Sub
Private Sub Form_Load()
Text1.Enabled = False
Text1.Text = Form6.Label9.Caption
Text2.Text = Form6.Label10.Caption
Combo1.Text = Form6.Label11.Caption
Text3.Text = Form6.Label12.Caption
Text4.Text = Form6.Label13.Caption
Text5.Text = Form6.Label14.Caption
If Form6.Label15.Caption = "guan" Then
Option1.Value = True
Option2.Value = False
Else
Option2.Value = True
Option1.Value = False
End If
cmd.CommandType = adCmdText
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -