📄 frmdept_de.frm
字号:
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 3165
TabIndex = 25
Top = 1815
Width = 1185
End
Begin VB.Label Label14
Caption = "电 话:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 240
TabIndex = 24
Top = 1815
Width = 1185
End
Begin VB.Label Label15
Caption = "身份证号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 240
TabIndex = 23
Top = 825
Width = 1185
End
Begin VB.Label Label16
Caption = "出生年月:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 3165
TabIndex = 22
Top = 1320
Width = 1185
End
Begin VB.Label Label17
Caption = "性 别:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 240
TabIndex = 21
Top = 1320
Width = 1185
End
Begin VB.Label Label18
Caption = "姓 名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 3165
TabIndex = 20
Top = 330
Width = 1185
End
Begin VB.Label Label19
Caption = "员工状态:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 3165
TabIndex = 19
Top = 4785
Width = 1185
End
End
Begin VB.Frame Frame3
Appearance = 0 'Flat
ForeColor = &H80000008&
Height = 1050
Left = 2445
TabIndex = 39
Top = 5415
Width = 6135
Begin VB.CommandButton Command2
Caption = "删 除(&D)"
Height = 510
Left = 2925
TabIndex = 42
Top = 315
Width = 1275
End
Begin VB.CommandButton Command3
Caption = "退 出(&E)"
Height = 510
Left = 4290
TabIndex = 41
Top = 315
Width = 1275
End
Begin VB.CommandButton Command4
Caption = "刷新(&F)"
Height = 510
Left = 1545
TabIndex = 40
Top = 315
Width = 1275
End
End
End
Attribute VB_Name = "frmDept_DE"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strHead As String
Dim strWid As String
'Dim pic() As Byte
Dim Filename As String
Private Sub Command2_Click()
Dim strYYY As String
If Text1.Text = "" Then: Exit Sub
If MsgBox("资料删除后将不在不再保留此数据,你是否要删除此份资料?", vbYesNo, "系统提示") = vbNo Then: Exit Sub
strYYY = "delete T_员工表 where 工号='" & Text1.Text & "'"
gCnn.Execute strYYY
MsgBox "删除成功!", vbInformation, "系统提示"
Call Form_Load
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Call Form_Load
End Sub
Private Sub Form_Load()
'ID,工号,姓名,性别,出生年月,身份证号,电话,手机,电子邮箱,住址,学历,民族,毕业院校,所学专业,上班日期,职务,职称,部门,员工状态,奖惩记录,培训记录,照片 T_员工表
Dim rs As New ADODB.Recordset
If Me.WindowState = 0 Then Me.Move 0, 0
Call ShowHead
If rs.State = 1 Then rs.Close
MSFlexGrid1.Rows = 1
gSQL = "select 工号,姓名,身份证号,性别,出生年月,电话,手机,电子邮箱,住址,民族,毕业院校,所学专业,上班日期,学历,职务,职称,部门,员工状态 from T_员工表 "
rs.Open gSQL, gCnn, adOpenStatic, adLockReadOnly
If rs.RecordCount >= 1 Then
rs.MoveFirst
Do While Not rs.EOF
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
MSFlexGrid1.Row = MSFlexGrid1.Rows - 1
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0) = rs.Fields(0).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 1) = rs.Fields(1).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2) = rs.Fields(2).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 3) = rs.Fields(3).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 4) = rs.Fields(4).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 5) = rs.Fields(5).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 6) = rs.Fields(6).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 7) = rs.Fields(7).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 8) = rs.Fields(8).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 9) = rs.Fields(9).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 10) = rs.Fields(10).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 11) = rs.Fields(11).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 12) = rs.Fields(12).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 13) = rs.Fields(13).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 14) = rs.Fields(14).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 15) = rs.Fields(15).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 16) = rs.Fields(16).Value
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 17) = rs.Fields(17).Value
rs.MoveNext
Loop
End If
If rs.State = 1 Then rs.Close
rs.Open "select VALUEID,VALUE from PARAMETERS where PARATYPE=2 order by VALUEID", gCnn, adOpenKeyset, adLockReadOnly, adCmdText
strMsg = AddListItem(Combo1, rs)
If strMsg <> "0" Then MsgBox strMsg, vbCritical, "系统提示"
Combo1.Text = Combo1.List(0)
If rs.State = 1 Then rs.Close
rs.Open "select VALUEID,VALUE from PARAMETERS where PARATYPE=3 order by VALUEID", gCnn, adOpenKeyset, adLockReadOnly, adCmdText
strMsg = AddListItem(Combo2, rs)
If strMsg <> "0" Then MsgBox strMsg, vbCritical, "系统提示"
Combo2.Text = Combo2.List(0)
If rs.State = 1 Then rs.Close
rs.Open "select VALUEID,VALUE from PARAMETERS where PARATYPE=1 order by VALUEID", gCnn, adOpenKeyset, adLockReadOnly, adCmdText
strMsg = AddListItem(Combo3, rs)
If strMsg <> "0" Then MsgBox strMsg, vbCritical, "系统提示"
Combo3.Text = Combo3.List(0)
If rs.State = 1 Then rs.Close
rs.Open "select VALUEID,VALUE from PARAMETERS where PARATYPE=4 order by VALUEID", gCnn, adOpenKeyset, adLockReadOnly, adCmdText
strMsg = AddListItem(Combo4, rs)
If strMsg <> "0" Then MsgBox strMsg, vbCritical, "系统提示"
Combo4.Text = Combo4.List(0)
If rs.State = 1 Then rs.Close
rs.Open "select VALUEID,VALUE from PARAMETERS where PARATYPE=5 order by VALUEID", gCnn, adOpenKeyset, adLockReadOnly, adCmdText
strMsg = AddListItem(Combo5, rs)
If strMsg <> "0" Then MsgBox strMsg, vbCritical, "系统提示"
Combo5.Text = Combo5.List(0)
gtxtclear
End Sub
Private Sub ShowHead()
'MSFlexGrid1设置
strHead = "工号,姓名,性别,出生年月,身份证号,电话,手机,电子邮箱,住址,民族,毕业院校,所学专业,上班日期,学历,职务,职称,部门,员工状态"
strWid = "800,1100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
FillGridHead MSFlexGrid1, strHead, strWid
End Sub
Private Sub MSFlexGrid1_Click()
If MSFlexGrid1.Rows = 1 Then Exit Sub
If MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 1) = "" Then Exit Sub
Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0)
Text1.Enabled = False
Text2.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 1)
Text3.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2)
Text4.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 3)
Text5.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 4)
Text6.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 5)
Text7.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 6)
Text8.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 7)
Text9.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 8)
Text10.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 9)
Text11.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 10)
Text12.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 11)
DTPicker1 = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 12)
Combo1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 13)
Combo2.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 14)
Combo3.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 15)
Combo4.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 16)
Combo5.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 17)
End Sub
Public Sub gtxtclear()
Text1.Enabled = True
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text11 = ""
Text12 = ""
DTPicker1 = Date
' Combo1 = ""
' Combo2 = ""
' Combo3 = ""
' Combo4 = ""
' Combo5 = ""
' Image1.Picture = LoadPicture("")
' Label1.Visible = True
End Sub
Private Sub Text3_LostFocus()
On Error GoTo Err_Handle
If Trim(Text3) = "" Then
MsgBox "请输入身份证号!", vbCritical, "系统提示"
Text3.SetFocus
Exit Sub
Else
If Len(Trim(Text3)) <> 15 And Len(Trim(Text3)) <> 18 Then
MsgBox "身份证号为15位或者18位!", vbCritical, "系统提示 "
Text3.SetFocus
Exit Sub
Else
If Len(Trim(Text3)) = 18 Then
Text5 = Format(DateSerial(Mid(Trim(Text3), 7, 4), Mid(Trim(Text3), 11, 2), Mid(Trim(Text3), 13, 2)), "yyyy-MM-dd")
If Mid(Trim(Text3), 17, 1) Mod 2 = 0 Then
Text4.Text = "女"
Else
Text4.Text = "男"
End If
Else
Text5 = Format(DateSerial(Mid(Trim(Text3), 7, 2), Mid(Trim(Text3), 9, 2), Mid(Trim(Text3), 11, 2)), "yyyy-MM-dd")
If Right(Trim(Text3), 1) Mod 2 = 0 Then
Text4.Text = "女"
Else
Text4.Text = "男"
End If
End If
End If
End If
Exit Sub
Err_Handle:
If Err.Number = 13 Then
MsgBox "确认身份证号是否正确!", vbInformation, "系统提示"
Text3.SetFocus
Else
MsgBox Err.Description, vbInformation, "系统提示"
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text11_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text12_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Combo3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Combo4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub Combo5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then SendKeys "{tab}"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -