📄 frmstaffedit.frm
字号:
BackStyle = 0 'Transparent
Caption = "工作日期"
Height = 195
Left = 3360
TabIndex = 22
Top = 2085
Width = 720
End
Begin VB.Label Label11
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "家庭电话"
Height = 180
Left = 6120
TabIndex = 21
Top = 1656
Width = 720
End
Begin VB.Label Label25
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "籍贯"
Height = 180
Left = 6120
TabIndex = 20
Top = 792
Width = 360
End
Begin VB.Label Label6
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "性别"
Height = 180
Left = 3360
TabIndex = 19
Top = 360
Width = 360
End
Begin VB.Label Label28
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "政治面貌"
Height = 180
Left = 3360
TabIndex = 18
Top = 792
Width = 720
End
Begin VB.Label Label21
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "工作证号"
Height = 195
Left = 6120
TabIndex = 17
Top = 1230
Width = 720
End
End
End
Attribute VB_Name = "FrmStaffEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Private Sub Cmd_Cancel_Click()
FrmStaffMan.TmpOk = False
Unload Me
End Sub
Private Sub Cmd_OK_Click()
With MyStaff
'姓名
.Staff_Name = MakeStr(txtStaff_Name)
'性别
.Sex = ComboSex.Text
'民族
.Nationality = MakeStr(txtNationality)
'生日
If IsDate(ComboBirth.Text) = False Then
MsgBox "请选择正确的出生日期"
Exit Sub
End If
.Birth = ComboBirth.Text
'政治面貌
.Political_Party = MakeStr(txtPolitical_Party)
'籍贯
.Family_Place = MakeStr(txtFamily_Place)
'身份证号
.Id_Card = MakeStr(txtId_Card)
'学生证号
.WorkID = MakeStr(txtWorkID)
'家庭电话
.Home_phone = MakeStr(txtHomePhone)
'居住地址
.Residence = MakeStr(txtResidence)
'邮政编号
.Postcode = MakeStr(txtPostcode)
'工作日期
If IsDate(ComboInDate.Text) = False Then
MsgBox "请选择正确的参加工作日期"
Exit Sub
End If
.InDate = ComboInDate.Text
'职务
.Title = MakeStr(txtTitle)
'备注
.Memo = MakeStr(txtMemo)
'填表时间
dd = Date
dd = Format(dd, "yyyy-mm-dd")
t = Time
tt = Trim(Str(Hour(t))) + ":" + Trim(Str(Minute(t))) + ":" + Trim(Str(Second(t)))
.Fillin_Time = dd + " " + tt
'部门编号
.Depart_Id = CurDepart.Depart_Id
'根据变量Modify,判断是插入新数据,还是修改已有的数据
If Modify = False Then
.Insert
Else
.Update (CurStaff.Staff_Id)
End If
End With
'设置员工管理窗体中的状态标识
FrmStaffMan.TmpOk = True
Unload Me
End Sub
Private Sub ComboBirth_GotFocus()
'将焦点设置为下一个控件,否则将反复执行此过程
txtPolitical_Party.SetFocus
'如果ComboBirth中包含日期,则将它赋值到FrmDateSel中
If ComboBirth.Text <> "" Then
FrmDateSel.OriDate = ComboBirth.Text
Else
FrmDateSel.OriDate = ""
End If
'设置FrmDateSel窗体的位置
FrmDateSel.Left = Me.Left + ComboBirth.Left + 350
FrmDateSel.Top = Me.Top + ComboBirth.Top + ComboBirth.Height + 450
FrmDateSel.Show 1
'将选择的日期显示到ComboBirth控件中
ComboBirth.Text = FrmDateSel.OriDate
End Sub
Private Sub ComboInDate_GotFocus()
txtTitle.SetFocus
If ComboInDate.Text <> "" Then
FrmDateSel.OriDate = ComboInDate.Text
Else
FrmDateSel.OriDate = ""
End If
FrmDateSel.Left = Me.Left + ComboInDate.Left
FrmDateSel.Top = Me.Top + ComboInDate.Top + ComboInDate.Height - FrmDateSel.Height
FrmDateSel.Show 1
ComboInDate.Text = FrmDateSel.OriDate
End Sub
Private Sub Form_Load()
If Modify = False Then
txtStaff_Name = ""
ComboSex.ListIndex = 0
txtNationality = ""
ComboBirth.Text = ""
txtPolitical_Party = ""
txtFamily_Place = ""
txtId_Card = ""
txtWorkID = ""
txtHomePhone = ""
txtResidence = ""
txtPostcode = ""
ComboInDate.Text = ""
txtTitle = ""
txtMemo = ""
Else
With CurStaff
'姓名
txtStaff_Name = .Staff_Name
'性别
If InCombo(.Sex, ComboSex) = True Then
ComboSex.Text = .Sex
End If
'民族
txtNationality = .Nationality
'生日
ComboBirth.Text = .Birth
'政治面貌
txtPolitical_Party = .Political_Party
'籍贯
txtFamily_Place = .Family_Place
'身份证
txtId_Card = .Id_Card
'学生证
txtWorkID = .WorkID
'家庭电话
txtHomePhone = .Home_phone
'家庭住址
txtResidence = .Residence
'邮政编码
txtPostcode = .Postcode
'工作时间
ComboInDate.Text = .InDate
'职务
txtTitle = .Title
'备注
txtMemo = .Memo
End With
End If
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub txtWorkID_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtStaff_Name_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtFamily_Place_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtHomePhone_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtId_Card_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtMemo_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtNationality_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtPolitical_Party_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtPostcode_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
If In_Int(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
Private Sub txtResidence_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtTitle_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -