⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formxz.frm

📁 人事管理系统 包含考勤
💻 FRM
📖 第 1 页 / 共 5 页
字号:
End If
If Not IsNull(Adcxzhd.Recordset.Fields("beizu").Value) Then
DC1.Text = Adcxzhd.Recordset.Fields("beizu").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xzl").Value) Then
Textxzname.Text = Adcxzhd.Recordset.Fields("xzl").Value
End If

End If
End Sub

Private Sub Command5_Click()
Dialogxz.Show
End Sub

Private Sub DC1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textxzname.SetFocus
End If
End Sub


Private Sub Form_Load()
Toolbar1.Buttons(4).Enabled = False

Adcxzhd.RecordSource = "select * from xzhd where zgid<>''order by zgid"
Adcxzhd.Refresh
If Not Adcxzhd.Recordset.EOF Then
Textcount.Text = Adcxzhd.Recordset.RecordCount
If Not IsNull(Adcxzhd.Recordset.Fields("zgid").Value) Then
Textzgid.Text = Adcxzhd.Recordset.Fields("zgid").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xzid").Value) Then
Text1xzid.Text = Adcxzhd.Recordset.Fields("xzid").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xben").Value) Then
Textxben.Text = Adcxzhd.Recordset.Fields("xben").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xjob").Value) Then
Textxjob.Text = Adcxzhd.Recordset.Fields("xjob").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xhouse").Value) Then
Textxhouse.Text = Adcxzhd.Recordset.Fields("xhouse").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xmange").Value) Then
Textxmange.Text = Adcxzhd.Recordset.Fields("xmange").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xfull").Value) Then
Textxfull.Text = Adcxzhd.Recordset.Fields("xfull").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xcount").Value) Then
Textxcount.Text = Adcxzhd.Recordset.Fields("xcount").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xother").Value) Then
Textxother.Text = Adcxzhd.Recordset.Fields("xother").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("sxdate").Value) Then
Textsxdate.Text = Adcxzhd.Recordset.Fields("sxdate").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("beizu").Value) Then
DC1.Text = Adcxzhd.Recordset.Fields("beizu").Value
End If
If Not IsNull(Adcxzhd.Recordset.Fields("xzl").Value) Then
Textxzname.Text = Adcxzhd.Recordset.Fields("xzl").Value
End If
End If
End Sub

Private Sub Text1xzid_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textxben.SetFocus
End If
End Sub

Private Sub Textbmname_Change()
Dim vbmid, vbmname As String
vbmid = Textbmname.Text
Adcbm.RecordSource = "select bmname from tbm where bmid ='" & vbmid & "'"
Adcbm.Refresh
If Not Adcbm.Recordset.EOF Then
vbmname = Adcbm.Recordset.Fields("bmname").Value
Textbmname.Text = vbmname
Textbmid.Text = vbmid
End If

End Sub

Private Sub Textjobname_Change()
Dim vjobid, vjobname As String
vjobid = Textjobname.Text
Adcjob.RecordSource = "select jobname from tjob where jobid ='" & vjobid & "'"
Adcjob.Refresh
If Not Adcjob.Recordset.EOF Then
vjobname = Adcjob.Recordset.Fields("jobname").Value
Textjobname.Text = vjobname
Textjobid.Text = vjobid
End If

End Sub

Private Sub Textstudyname_Change()
Dim vstudyid, vstudyname As String
vstudyid = Textstudyname.Text
Adcstudy.RecordSource = "select * from tstudy where studyid ='" & vstudyid & "'"
Adcstudy.Refresh
If Not Adcstudy.Recordset.EOF Then
vstudyname = Adcstudy.Recordset.Fields("studyname").Value
Textstudyname.Text = vstudyname
Textstudyid.Text = vstudyid
End If

End Sub




Private Sub Textsxdate_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
DC1.SetFocus
End If
End Sub

Private Sub Textxben_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textxjob.SetFocus
End If

End Sub

Private Sub Textxfull_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textxother.SetFocus
End If

End Sub

Private Sub Textxhouse_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textxmange.SetFocus
End If

End Sub

Private Sub Textxjob_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textxhouse.SetFocus
End If

End Sub

Private Sub Textxmange_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textxfull.SetFocus
End If

End Sub

Private Sub Textxother_KeyPress(KeyAscii As Integer)
Dim vxben, vxjob, vxfull, vxmange, vxhouse, vxother
Dim vxcount
vxben = 0
vxfull = 0
vxmange = 0
vxhouse = 0
vxjob = 0
vxother = 0
vxcount = 0
If KeyAscii = 13 Then
If Textxben.Text <> "" Then
vxben = Val(Textxben.Text)
End If
If Textxjob.Text <> "" Then
vxjob = Val(Textxjob.Text)
End If
If Textxfull.Text <> "" Then
vxfull = Val(Textxfull.Text)
End If
If Textxhouse.Text <> "" Then
vxhouse = Val(Textxhouse.Text)
End If
If Textxother.Text <> "" Then
vxother = Val(Textxother.Text)
End If
If Textxmange.Text <> "" Then
vxmange = Val(Textxmange.Text)
End If
vxcount = vxben + vxjob + vxhouse + vxmange + vxfull + vxother
Textxcount.Text = vxcount
Textsxdate.SetFocus
End If

End Sub

Private Sub Textxzid_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textxben.SetFocus
End If
End Sub

Private Sub Textxzname_Change()
Dim vxzid, vxzname As String
vxzid = Textxzname.Text
Adcxz.RecordSource = "select * from xzl where xzlid ='" & vxzid & "'"
Adcxz.Refresh
If Not Adcxz.Recordset.EOF Then
vxzname = Adcxz.Recordset.Fields("xzlname").Value
Textxzname.Text = vxzname
Textxzid.Text = vxzid
End If

End Sub

Private Sub Textzgid_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If IsNull(Textzgid.Text) Then
MsgBox ("没有输入工号")
Textzgid.SetFocus
Else
vzgid = Textzgid.Text
adczg.RecordSource = "select * from tzg where zgid='" & vzgid & "'"
adczg.Refresh
If Not adczg.Recordset.EOF Then
If Not IsNull(adczg.Recordset.Fields("zgname").Value) Then
Textzgname = adczg.Recordset.Fields("zgname").Value
End If
If Not IsNull(adczg.Recordset.Fields("bmid").Value) Then
Textbmname.Text = adczg.Recordset.Fields("bmid").Value
End If
If Not IsNull(adczg.Recordset.Fields("jobid").Value) Then
Textjobname.Text = adczg.Recordset.Fields("jobid").Value
End If
If Not IsNull(adczg.Recordset.Fields("studyid").Value) Then
Textstudyname.Text = adczg.Recordset.Fields("studyid").Value
End If
If Not IsNull(adczg.Recordset.Fields("workdate").Value) Then
Textworkdate.Text = adczg.Recordset.Fields("workdate").Value
End If
If Not IsNull(adczg.Recordset.Fields("writedate").Value) Then
Textwritedate.Text = adczg.Recordset.Fields("writedate").Value
End If
If Not IsNull(adczg.Recordset.Fields("jobcid").Value) Then
Textjobc.Text = adczg.Recordset.Fields("jobcid").Value
End If
If Not IsNull(adczg.Recordset.Fields("jobj").Value) Then
Textjobj.Text = adczg.Recordset.Fields("jobj").Value
End If
Text1xzid.SetFocus
End If
End If
End If

End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim response, iresponse As Integer
Dim vdate1
Select Case Button.Index
Case 1
Adcxzhd.Recordset.AddNew
Textzgid.Text = ""
Textzgname.Text = ""
Textbmname.Text = ""
Textjobname.Text = ""
Textstudyname.Text = ""
Textworkdate.Text = ""
Textwritedate.Text = ""
Textjobc.Text = ""
Textjobj.Text = ""
Text1xzid.Text = ""
Textxben.Text = ""
Textxjob.Text = ""
Textxhouse.Text = ""
Textxmange.Text = ""
Textxother.Text = ""
Textxcount.Text = ""
DC1.Text = ""
baddnewflag = True
setbuttons False
Toolbar1.Buttons(4).Enabled = True
Case 2
response = MsgBox("Are you sure", vbYesNo, "delete record")
If response = vbYes Then
Adcxzhd.Recordset.Delete
Adcxzhd.Recordset.MoveNext
End If
If Adcxzhd.Recordset.EOF Then
Adcxzhd.Recordset.MoveLast
End If
Case 3
Adcxzhd.RecordSource = "select * from xzhd where zgid<>'' order by zgid "
Adcxzhd.Refresh
If Adcxzhd.Recordset.EOF Then
Textcount.Text = 0
Else
Textcount.Text = Adcxzhd.Recordset.RecordCount
End If
Case 4
response = MsgBox("你确信要更新", vbYesNo, "更新数据")
If response = vbYes Then
If Textzgid.Text = "" Or Not IsDate(Textsxdate.Text) Then
MsgBox ("有空值,请检察")
Textzgid.SetFocus
Else
Adcxzhd.Recordset.Fields("zgid").Value = Textzgid.Text
Adcxzhd.Recordset.Fields("zgname").Value = Textzgname.Text
Adcxzhd.Recordset.Fields("bmid").Value = Textbmid.Text
Adcxzhd.Recordset.Fields("jobid").Value = Textjobid.Text
Adcxzhd.Recordset.Fields("sxdate").Value = Textsxdate.Text
Adcxzhd.Recordset.Fields("studyid").Value = Textstudyid.Text
Adcxzhd.Recordset.Fields("workdate").Value = Textworkdate.Text
Adcxzhd.Recordset.Fields("writedate").Value = Textwritedate.Text
Adcxzhd.Recordset.Fields("jobc").Value = Textjobc.Text
Adcxzhd.Recordset.Fields("jobj").Value = Textjobj.Text
Adcxzhd.Recordset.Fields("xzid").Value = Text1xzid.Text
Adcxzhd.Recordset.Fields("beizu").Value = DC1.Text
Adcxzhd.Recordset.Fields("xben").Value = Textxben.Text
Adcxzhd.Recordset.Fields("xjob").Value = Textxjob.Text
Adcxzhd.Recordset.Fields("xhouse").Value = Textxhouse.Text
Adcxzhd.Recordset.Fields("xmange").Value = Textxmange.Text
Adcxzhd.Recordset.Fields("xfull").Value = Textxfull.Text
Adcxzhd.Recordset.Fields("xother").Value = Textxother.Text
Adcxzhd.Recordset.Fields("xcount").Value = Textxcount.Text
Adcxzhd.Recordset.Fields("xzl").Value = Textxzid.Text
Adcxzhd.Recordset.Update
End If
End If
setbuttons True
Toolbar1.Buttons(4).Enabled = False
Case 5
response = MsgBox("你确信取消操作", vbYesNo, "取消操作")
If response = vbYes Then
setbuttons True
Adcxzhd.Recordset.CancelUpdate
If vbookmark > 0 Then
Adcxzhd.Recordset.Bookmark = vbookmark
Else
Adcxzhd.Recordset.MoveFirst
End If
Toolbar1.Buttons(3).Enabled = False
baddnewflag = False
End If
Case 6
If Toolbar1.Buttons(4).Enabled Then
iresponse = MsgBox("data changed ,save it?", vbYesNo, "update data?")
If iresponse = vbYes Then
Adcxzhd.Recordset.Update
 Else
Adcxzhd.Recordset.CancelUpdate
End If
End If
Unload Me
Case 7
Dialogxzfind.Show
Case 8
Adcxzhd.Recordset.MoveFirst
Case 9
If Not Adcxzhd.Recordset.BOF Then
Adcxzhd.Recordset.MovePrevious
End If
Case 10
If Not Adcxzhd.Recordset.EOF Then
Adcxzhd.Recordset.MoveNext
End If
Case 11
Adcxzhd.Recordset.MoveLast
Case 12
Toolbar1.Buttons(4).Enabled = True
End Select


End Sub
Private Sub setbuttons(bval As Boolean)
Toolbar1.Buttons(1).Enabled = bval
Toolbar1.Buttons(2).Enabled = bval
Toolbar1.Buttons(3).Enabled = bval
Toolbar1.Buttons(6).Enabled = bval
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -