📄 frmyggl.frm
字号:
VERSION 5.00
Begin VB.Form FrmYGGL
BorderStyle = 0 'None
Caption = "员工档案"
ClientHeight = 5385
ClientLeft = 2160
ClientTop = 2835
ClientWidth = 10080
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5385
ScaleWidth = 10080
ShowInTaskbar = 0 'False
Begin VB.PictureBox Picture2
Appearance = 0 'Flat
BackColor = &H80000000&
ForeColor = &H80000008&
Height = 3855
Left = 90
ScaleHeight = 3825
ScaleWidth = 9825
TabIndex = 4
Top = 960
Width = 9855
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000000&
ForeColor = &H80000008&
Height = 4080
Left = 0
ScaleHeight = 4050
ScaleWidth = 9465
TabIndex = 6
Top = -255
Width = 9495
Begin VB.Label Label1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "操 作"
ForeColor = &H80000008&
Height = 255
Left = 8520
TabIndex = 15
Top = 0
Width = 975
End
Begin VB.Label LabXG
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00FFFFC0&
BorderStyle = 1 'Fixed Single
Caption = "修改"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 8520
TabIndex = 14
Top = 0
Width = 495
End
Begin VB.Label LabDel
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00C0C0FF&
BorderStyle = 1 'Fixed Single
Caption = "删除"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 9000
TabIndex = 13
Top = 0
Width = 495
End
Begin VB.Label LabBh
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "编号"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 0
TabIndex = 12
Top = 0
Width = 615
End
Begin VB.Label LabName
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "员工姓名"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 600
TabIndex = 11
Top = 0
Width = 1215
End
Begin VB.Label LabZW
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "员工职务"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 1800
TabIndex = 10
Top = 0
Width = 1215
End
Begin VB.Label LabTele
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "电话"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 3000
TabIndex = 9
Top = 0
Width = 1815
End
Begin VB.Label LabDZ
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "地址"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 4800
TabIndex = 8
Top = 0
Width = 2775
End
Begin VB.Label LabBZ
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "备注"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 7560
TabIndex = 7
Top = 0
Width = 975
End
End
Begin VB.VScrollBar VScroll1
Height = 3855
LargeChange = 2400
Left = 9600
Max = 255
SmallChange = 255
TabIndex = 5
Top = 0
Width = 255
End
End
Begin VB.CommandButton Command4
Caption = "新 添"
Height = 375
Left = 6960
TabIndex = 2
Top = 4920
Width = 855
End
Begin VB.CommandButton Command3
Caption = "关 闭"
Height = 375
Left = 8400
TabIndex = 1
Top = 4920
Width = 975
End
Begin VB.CommandButton Command1
Caption = "打 印"
Height = 375
Left = 5760
TabIndex = 0
Top = 4920
Width = 855
End
Begin VB.Label Label7
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "备注"
ForeColor = &H00C00000&
Height = 255
Left = 7680
TabIndex = 22
Top = 720
Width = 975
End
Begin VB.Label Label6
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "地址"
ForeColor = &H00C00000&
Height = 255
Left = 4920
TabIndex = 21
Top = 720
Width = 2775
End
Begin VB.Label Label5
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "电话"
ForeColor = &H00C00000&
Height = 255
Left = 3120
TabIndex = 20
Top = 720
Width = 1815
End
Begin VB.Label Label4
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "员工职务"
ForeColor = &H00C00000&
Height = 255
Left = 1920
TabIndex = 19
Top = 720
Width = 1215
End
Begin VB.Label Label3
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "员工姓名"
ForeColor = &H00C00000&
Height = 255
Left = 720
TabIndex = 18
Top = 720
Width = 1215
End
Begin VB.Label Label2
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "编号"
ForeColor = &H00C00000&
Height = 255
Left = 120
TabIndex = 17
Top = 720
Width = 615
End
Begin VB.Label Label8
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "操 作"
ForeColor = &H00C00000&
Height = 255
Left = 8640
TabIndex = 16
Top = 720
Width = 975
End
Begin VB.Label LabNmae
Caption = "临沂市长安物贸有限公司员工档案"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 3000
TabIndex = 3
Top = 240
Width = 3975
End
End
Attribute VB_Name = "FrmYGGL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Command1_Click()
SqlBase = "SELECT * FROM 员工表"
PublicPath = App.Path & "\ygda.rpt"
FrmPrinter.Show
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
FrmYGGLAdd.Show
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2
Set Rs = New Recordset
VScroll1.Visible = False
Set_Init
End Sub
Private Sub Set_Init()
sSql = "SELECT * FROM 员工表"
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
i = 1
Do While Not Rs.EOF
Load LabBh(i)
Load LabName(i)
Load LabZW(i)
Load LabTele(i)
Load LabDZ(i)
Load LabBZ(i)
Load LabXG(i)
Load LabDel(i)
LabBh(i).Top = LabBh(i - 1).Top + 255
LabName(i).Top = LabName(i - 1).Top + 255
LabZW(i).Top = LabZW(i - 1).Top + 255
LabTele(i).Top = LabTele(i - 1).Top + 255
LabDZ(i).Top = LabDZ(i - 1).Top + 255
LabBZ(i).Top = LabBZ(i - 1).Top + 255
LabXG(i).Top = LabXG(i - 1).Top + 255
LabDel(i).Top = LabDel(i - 1).Top + 255
LabBh(i).Visible = True:
LabName(i).Visible = True
LabZW(i).Visible = True
LabTele(i).Visible = True
LabDZ(i).Visible = True
LabBZ(i).Visible = True
LabXG(i).Visible = True
LabDel(i).Visible = True
LabBh(i) = i
LabName(i) = Rs("姓名")
LabZW(i) = Rs("职务")
LabTele(i) = Rs("电话")
LabDZ(i) = Rs("地址")
If Rs("备注") = "-" Then LabBZ(i) = "" Else LabBZ(i) = Rs("备注")
LabXG(i).LinkItem = Rs("ID")
LabDel(i).LinkItem = Rs("ID")
i = i + 1
If i > 16 Then
Picture1.Height = Picture1.Height + 255
VScroll1.Visible = True
VScroll1.Max = (i - 16) * 255
End If
Rs.MoveNext
Loop
Rs.Close
End Sub
Private Sub LabDel_Click(Index As Integer)
Dim a As Integer
sSql = "select * FROM 员工表 where ID =" & Val(LabDel(Index).LinkItem)
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
If Trim(Rs!姓名) = "管理员" Then
MsgBox "对不起,管理员不能被删除!"
Rs.Close
Exit Sub
End If
a = MsgBox("********你确定要删除此员工档案信息吗?**********" & vbCrLf _
& "一旦删除将不可更改!" & vbCrLf _
, vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
sSql = "delete FROM 员工表 where ID =" & Val(LabDel(Index).LinkItem)
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
Set_Unload
Set_Init
End If
If a = 2 Then Exit Sub
End Sub
Private Sub LabXG_Click(Index As Integer)
sSql = "select * FROM 员工表 where ID =" & Val(LabXG(Index).LinkItem)
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
If Trim(Rs!姓名) = "管理员" Then
MsgBox "对不起,管理员不能被修改!"
Rs.Close
Exit Sub
End If
RemId = Val(LabXG(Index).LinkItem)
FrmYGGLXG.Show
Unload Me
End Sub
Private Sub Set_Unload() '卸载各lab
For i = 1 To LabBh.Count - 1
Unload LabBh(i)
Unload LabName(i)
Unload LabZW(i)
Unload LabTele(i)
Unload LabDZ(i)
Unload LabBZ(i)
Unload LabXG(i)
Unload LabDel(i)
Next i
End Sub
Private Sub VScroll1_Change()
Picture1.Top = VScroll1.Value * (-1) - 255
End Sub
Private Sub VScroll1_Scroll()
Picture1.Top = VScroll1.Value * (-1) - 255
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -