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

📄 formzs.frm

📁 人事管理系统 包含考勤
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
      OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adcbm"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adczg 
      Height          =   330
      Left            =   480
      Top             =   6000
      Visible         =   0   'False
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
      OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adczg"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   735
      Left            =   0
      TabIndex        =   8
      Top             =   0
      Width           =   8565
      _ExtentX        =   15108
      _ExtentY        =   1296
      ButtonWidth     =   820
      ButtonHeight    =   1138
      Appearance      =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   12
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "新建"
            Object.ToolTipText     =   "新建"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "删除"
            Object.ToolTipText     =   "删除"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "刷新"
            Object.ToolTipText     =   "刷新"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "保存"
            Object.ToolTipText     =   "保存"
            ImageIndex      =   4
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "取消"
            Object.ToolTipText     =   "取消"
            ImageIndex      =   5
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "退出"
            Object.ToolTipText     =   "退出"
            ImageIndex      =   6
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "查询"
            Object.ToolTipText     =   "查询员工"
            ImageIndex      =   7
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   8
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   9
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   10
         EndProperty
         BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   11
         EndProperty
         BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "修改"
            ImageIndex      =   13
         EndProperty
      EndProperty
   End
   Begin VB.Label Label8 
      Caption         =   "记录"
      Height          =   255
      Left            =   2040
      TabIndex        =   18
      Top             =   5640
      Width           =   495
   End
   Begin VB.Label Label7 
      Caption         =   "合计"
      Height          =   255
      Left            =   600
      TabIndex        =   16
      Top             =   5640
      Width           =   375
   End
   Begin VB.Label Label6 
      Caption         =   "结束日期"
      Height          =   255
      Left            =   2760
      TabIndex        =   12
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label5 
      Caption         =   "开始日期"
      Height          =   255
      Left            =   600
      TabIndex        =   10
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label4 
      Caption         =   "职务"
      Height          =   255
      Left            =   5880
      TabIndex        =   7
      Top             =   840
      Width           =   495
   End
   Begin VB.Label Label1 
      Caption         =   "工号"
      Height          =   255
      Left            =   600
      TabIndex        =   6
      Top             =   840
      Width           =   375
   End
   Begin VB.Label Label2 
      Caption         =   "姓名"
      Height          =   255
      Left            =   2280
      TabIndex        =   5
      Top             =   840
      Width           =   375
   End
   Begin VB.Label Label3 
      Caption         =   "部门"
      Height          =   255
      Left            =   3960
      TabIndex        =   4
      Top             =   840
      Width           =   375
   End
End
Attribute VB_Name = "Formzs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim vzgid, vbmid, vjobid, vzgname, vbmname, vjobname
Dim vbookmark As Variant
Dim lcurrrec As Long
Dim baddnewflag As Boolean
Dim WithEvents adors As Recordset
Attribute adors.VB_VarHelpID = -1
Dim vmonth
Dim vcount

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

Private Sub Adczsred_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
If Not Adczsred.Recordset.EOF Then
If Not IsNull(Adczsred.Recordset.Fields("zgid").Value) Then
Textzgid.Text = Adczsred.Recordset.Fields("zgid").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("zgname").Value) Then
Textzgname.Text = Adczsred.Recordset.Fields("zgname").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("bmid").Value) Then
Textbmname.Text = Adczsred.Recordset.Fields("bmid").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("jobid").Value) Then
Textjobname.Text = Adczsred.Recordset.Fields("jobid").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("sdate").Value) Then
textsdate.Text = Adczsred.Recordset.Fields("sdate").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("edate").Value) Then
Textedate.Text = Adczsred.Recordset.Fields("sedate").Value
End If
End If
End Sub

Private Sub Form_Load()
Toolbar1.Buttons(4).Enabled = False
Adczsred.RecordSource = "select * from zsred where zgid<>'' order by zgid"
Adczsred.Refresh
If Not Adczsred.Recordset.EOF Then
Textcount.Text = Adczsred.Recordset.RecordCount
If Not IsNull(Adczsred.Recordset.Fields("zgid").Value) Then
Textzgid.Text = Adczsred.Recordset.Fields("zgid").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("zgname").Value) Then
Textzgname.Text = Adczsred.Recordset.Fields("zgname").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("bmid").Value) Then
Textbmname.Text = Adczsred.Recordset.Fields("bmid").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("jobid").Value) Then
Textjobname.Text = Adczsred.Recordset.Fields("jobid").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("sdate").Value) Then
textsdate.Text = Adczsred.Recordset.Fields("sdate").Value
End If
If Not IsNull(Adczsred.Recordset.Fields("edate").Value) Then
Textedate.Text = Adczsred.Recordset.Fields("edate").Value
End If

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 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
textsdate.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
If Not (Adczsred.Recordset.BOF And Adczsred.Recordset.EOF) Then
vbookmark = Adczsred.Recordset.Bookmark
End If
Adczsred.Recordset.AddNew
Textzgid.Text = ""
Textzgname.Text = ""
Textbmname = ""
Textjobname = ""
textsdate.Text = ""
Textedate.Text = ""
Textzgid.SetFocus
baddnewflag = True
setbuttons False
Toolbar1.Buttons(4).Enabled = True
Case 2
response = MsgBox("Are you sure", vbYesNo, "delete record")
If response = vbYes Then
Adczsred.Recordset.Delete
Adczsred.Recordset.MoveNext
End If
If Adczsred.Recordset.EOF Then
Textzgid.Text = ""
Textzgname.Text = ""
Textbmname.Text = ""
Textjobname.Text = ""
textsdate.Text = ""
Textedate.Text = ""
End If
Case 3
Adczsred.RecordSource = "select * from zsred where zgid<>'' order by zgid"
Adczsred.Refresh
Case 4
response = MsgBox("你确信要更新", vbYesNo, "更新数据")
If response = vbYes Then
If Textzgid.Text = "" Or Not IsDate(textsdate.Text) Then
MsgBox ("有空值,请检察")
Textzgid.SetFocus
Else
vdate1 = textsdate.Text
Adczsred1.RecordSource = "select * from zsred where zgid='" & vzgid & "' order by zgid"
Adczsred1.Refresh

If Not Adczsred1.Recordset.EOF Then
MsgBox ("已存在相同的记录")
Else

Adczsred.Recordset.Fields("zgid").Value = Textzgid.Text
Adczsred.Recordset.Fields("zgname").Value = Textzgname.Text
Adczsred.Recordset.Fields("bmid").Value = Textbmid.Text
Adczsred.Recordset.Fields("jobid").Value = Textjobid.Text
Adczsred.Recordset.Fields("sdate").Value = textsdate.Text
If IsDate(Textedate.Text) Then
Adczsred.Recordset.Fields("edate").Value = Textedate.Text
End If
Adczsred.Recordset.Update
End If
End If
End If
setbuttons True
Toolbar1.Buttons(4).Enabled = False
Case 5
response = MsgBox("你确信取消操作", vbYesNo, "取消操作")
If response = vbYes Then
setbuttons True
Adczsred.Recordset.CancelUpdate
If vbookmark > 0 Then
Adczsred.Recordset.Bookmark = vbookmark
Else
Adczsred.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
Adczsred.Recordset.Update
 Else
Adczsred.Recordset.CancelUpdate
End If
End If
Unload Me
Case 7
Dialogzs.Show
Case 8
Adczsred.Recordset.MoveFirst
Case 9
If Not Adczsred.Recordset.BOF Then
Adczsred.Recordset.MovePrevious
End If
Case 10
If Not Adczsred.Recordset.EOF Then
Adczsred.Recordset.MoveNext
End If
Case 11
Adczsred.Recordset.MoveLast
Case 12
Toolbar1.Buttons(4).Enabled = True
End Select

End Sub

⌨️ 快捷键说明

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