📄 form6.frm
字号:
VERSION 5.00
Begin VB.Form Form6
BorderStyle = 0 'None
Caption = "编号查询界面"
ClientHeight = 6465
ClientLeft = 0
ClientTop = 0
ClientWidth = 7725
LinkTopic = "Form6"
ScaleHeight = 6465
ScaleWidth = 7725
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command3
Caption = "删除信息"
Height = 375
Left = 6600
TabIndex = 19
Top = 480
Width = 975
End
Begin VB.CommandButton Command2
Caption = "修改信息"
Height = 375
Left = 5400
TabIndex = 18
Top = 480
Width = 975
End
Begin VB.Frame Frame1
Caption = "职工信息"
Height = 4935
Left = 240
TabIndex = 3
Top = 1080
Width = 7215
Begin VB.Label Label15
Caption = "Label15"
Height = 255
Left = 1320
TabIndex = 17
Top = 4080
Width = 4095
End
Begin VB.Label Label14
Caption = "Label14"
Height = 255
Left = 1320
TabIndex = 16
Top = 3360
Width = 4695
End
Begin VB.Label Label13
Caption = "Label13"
Height = 375
Left = 1320
TabIndex = 15
Top = 2640
Width = 4815
End
Begin VB.Label Label12
Caption = "Label12"
Height = 255
Left = 1320
TabIndex = 14
Top = 2040
Width = 3375
End
Begin VB.Label Label11
Caption = "sdfsdf"
Height = 255
Left = 1320
TabIndex = 13
Top = 1440
Width = 4095
End
Begin VB.Label Label10
Caption = "00"
Height = 255
Left = 1320
TabIndex = 12
Top = 960
Width = 3735
End
Begin VB.Label Label9
Caption = "00"
Height = 255
Left = 1320
TabIndex = 11
Top = 480
Width = 3255
End
Begin VB.Label Label8
Caption = "权限"
Height = 375
Left = 240
TabIndex = 10
Top = 4080
Width = 495
End
Begin VB.Label Label7
Caption = "身份证号码"
Height = 375
Left = 120
TabIndex = 9
Top = 3360
Width = 1095
End
Begin VB.Label Label6
Caption = "地址"
Height = 375
Left = 240
TabIndex = 8
Top = 2640
Width = 735
End
Begin VB.Label Label5
Caption = "年龄"
Height = 255
Left = 240
TabIndex = 7
Top = 2040
Width = 615
End
Begin VB.Label Label4
Caption = "性别"
Height = 255
Left = 240
TabIndex = 6
Top = 1440
Width = 615
End
Begin VB.Label Label3
Caption = "姓名"
Height = 255
Left = 240
TabIndex = 5
Top = 960
Width = 735
End
Begin VB.Label Label2
Caption = "编号"
Height = 255
Left = 240
TabIndex = 4
Top = 480
Width = 615
End
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 4320
TabIndex = 2
Top = 480
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
TabIndex = 1
Top = 480
Width = 2775
End
Begin VB.Label Label1
Caption = "输入编号"
Height = 255
Left = 240
TabIndex = 0
Top = 480
Width = 855
End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim return_msg As VbMsgBoxResult
Private Sub Command1_Click()
cmd.CommandText = "select * from xinxi0504_23_employee where employee_id='" & Trim(Text1.Text) & "'"
Set rs = cmd.Execute
If rs.EOF = True Then
Label9.Caption = ""
Label10.Caption = ""
Label11.Caption = ""
Label12.Caption = ""
Label13.Caption = ""
Label14.Caption = ""
Label15.Caption = ""
Command2.Enabled = False
Command3.Enabled = False
MsgBox "该职工不存在或编号输入错误"
Else
Label9.Caption = rs.Fields("employee_id")
Label10.Caption = rs.Fields("employee_name")
Label11.Caption = rs.Fields("employee_sex")
Label12.Caption = rs.Fields("employee_age")
Label13.Caption = rs.Fields("employee_addr")
Label14.Caption = rs.Fields("employee_ident")
Label15.Caption = rs.Fields("authority")
Command2.Enabled = True
Command3.Enabled = True
End If
End Sub
Private Sub Command2_Click()
If Label9.Caption = "" Then
MsgBox "没有需要修改的职工信息"
Else
Form14.Show
Unload Form5
Unload Form6
Unload Form7
Unload Form8
Unload Form9
Unload Form10
Unload Form13
SetParent Form14.hWnd, Form4.hWnd
End If
End Sub
Private Sub Command3_Click()
return_msg = MsgBox("确认删除?", vbYesNo)
If return_msg = vbNo Then
Exit Sub
ElseIf Label9.Caption = employee_id Then
MsgBox "不能删除自己"
Else
cmd.CommandText = "delete from xinxi0504_23_employee where employee_id='" & Trim(Label9.Caption) & "'"
cmd.Execute
MsgBox "删除记录成功"
Label9.Caption = ""
Label10.Caption = ""
Label11.Caption = ""
Label12.Caption = ""
Label13.Caption = ""
Label14.Caption = ""
Label15.Caption = ""
Command2.Enabled = False
Command3.Enabled = False
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Label9.Caption = ""
Label10.Caption = ""
Label11.Caption = ""
Label12.Caption = ""
Label13.Caption = ""
Label14.Caption = ""
Label15.Caption = ""
Command2.Enabled = False
Command3.Enabled = False
Set rs = New ADODB.Recordset
cmd.CommandType = adCmdText
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -