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

📄 kqtj.frm

📁 一个关于企业工资管理的数据库应用的例子。
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Height          =   255
            Left            =   240
            TabIndex        =   23
            Top             =   360
            Width           =   1095
         End
         Begin VB.Label Label2 
            Caption         =   "员工姓名:"
            Height          =   255
            Left            =   3240
            TabIndex        =   22
            Top             =   360
            Width           =   975
         End
         Begin VB.Label Label3 
            Caption         =   "性别:"
            Height          =   255
            Left            =   240
            TabIndex        =   21
            Top             =   720
            Width           =   615
         End
         Begin VB.Label Label4 
            Caption         =   "职务:"
            Height          =   255
            Left            =   3240
            TabIndex        =   20
            Top             =   720
            Width           =   735
         End
         Begin VB.Label Label5 
            Caption         =   "所在部门:"
            Height          =   255
            Left            =   240
            TabIndex        =   19
            Top             =   1200
            Width           =   975
         End
         Begin VB.Label Label6 
            Caption         =   "全勤天数:"
            Height          =   255
            Left            =   240
            TabIndex        =   18
            Top             =   1680
            Width           =   975
         End
         Begin VB.Label Label7 
            Caption         =   "应出勤天数:"
            Height          =   255
            Left            =   3240
            TabIndex        =   17
            Top             =   1680
            Width           =   1335
         End
         Begin VB.Label Label8 
            Caption         =   "起始日期:"
            Height          =   255
            Left            =   240
            TabIndex        =   16
            Top             =   2160
            Width           =   1095
         End
         Begin VB.Label Label9 
            Caption         =   "截止日期:"
            Height          =   255
            Left            =   3240
            TabIndex        =   15
            Top             =   2160
            Width           =   975
         End
         Begin VB.Label Label10 
            Caption         =   "请假类型:"
            Height          =   255
            Left            =   240
            TabIndex        =   14
            Top             =   2640
            Width           =   975
         End
         Begin VB.Label Label11 
            Caption         =   "审批人:"
            Height          =   255
            Left            =   3240
            TabIndex        =   13
            Top             =   2640
            Width           =   735
         End
         Begin VB.Label Label12 
            Caption         =   "请假事由:"
            Height          =   255
            Left            =   240
            TabIndex        =   12
            Top             =   3120
            Width           =   975
         End
      End
      Begin VSFlex8Ctl.VSFlexGrid VSFlexGrid1 
         Bindings        =   "kqtj.frx":02A3
         Height          =   3975
         Left            =   120
         TabIndex        =   1
         Top             =   960
         Width           =   5895
         _cx             =   10398
         _cy             =   7011
         Appearance      =   1
         BorderStyle     =   1
         Enabled         =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         MousePointer    =   0
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         BackColorFixed  =   -2147483633
         ForeColorFixed  =   -2147483630
         BackColorSel    =   -2147483635
         ForeColorSel    =   -2147483634
         BackColorBkg    =   -2147483636
         BackColorAlternate=   -2147483643
         GridColor       =   -2147483633
         GridColorFixed  =   -2147483632
         TreeColor       =   -2147483632
         FloodColor      =   192
         SheetBorder     =   -2147483642
         FocusRect       =   1
         HighLight       =   1
         AllowSelection  =   -1  'True
         AllowBigSelection=   -1  'True
         AllowUserResizing=   0
         SelectionMode   =   0
         GridLines       =   1
         GridLinesFixed  =   2
         GridLineWidth   =   1
         Rows            =   50
         Cols            =   10
         FixedRows       =   1
         FixedCols       =   1
         RowHeightMin    =   0
         RowHeightMax    =   0
         ColWidthMin     =   0
         ColWidthMax     =   0
         ExtendLastCol   =   0   'False
         FormatString    =   ""
         ScrollTrack     =   0   'False
         ScrollBars      =   3
         ScrollTips      =   0   'False
         MergeCells      =   0
         MergeCompare    =   0
         AutoResize      =   -1  'True
         AutoSizeMode    =   0
         AutoSearch      =   0
         AutoSearchDelay =   2
         MultiTotals     =   -1  'True
         SubtotalPosition=   1
         OutlineBar      =   0
         OutlineCol      =   0
         Ellipsis        =   0
         ExplorerBar     =   0
         PicturesOver    =   0   'False
         FillStyle       =   0
         RightToLeft     =   0   'False
         PictureType     =   0
         TabBehavior     =   0
         OwnerDraw       =   0
         Editable        =   0
         ShowComboButton =   1
         WordWrap        =   0   'False
         TextStyle       =   0
         TextStyleFixed  =   0
         OleDragMode     =   0
         OleDropMode     =   0
         DataMode        =   0
         VirtualData     =   -1  'True
         DataMember      =   ""
         ComboSearch     =   3
         AutoSizeMouse   =   -1  'True
         FrozenRows      =   0
         FrozenCols      =   0
         AllowUserFreezing=   0
         BackColorFrozen =   0
         ForeColorFrozen =   0
         WallPaperAlignment=   9
         AccessibleName  =   ""
         AccessibleDescription=   ""
         AccessibleValue =   ""
         AccessibleRole  =   24
      End
   End
End
Attribute VB_Name = "kqtj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
Adodc1.Recordset.AddNew
Call txtvalue2
Call TxtState
Call state1
Dim conn As New ADODB.Connection
conn.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=qygzgl"
'rsc.CursorLocation = adUseClient
If rsc.State = adStateClosed Then
    rsc.Open "员工档案表", conn, adOpenKeyset, adLockOptimistic, adCmdTable
End If
Set DataCombo1.RowSource = rsc
DataCombo1.BoundColumn = "员工编号"
DataCombo1.ListField = "员工编号"

End Sub

Private Sub Command2_Click()
Call state1
Call TxtState
End Sub

Private Sub command3_click()
If MsgBox("确定要删除吗?", vbInformation + vbYesNo, "删除信息") = vbYes Then
   
    If Adodc1.Recordset.RecordCount <> 0 Then
        Adodc1.Recordset.Delete
        Adodc1.Refresh '//删除记录
        MsgBox ("删除成功!")
        Call command5_click
    Else
        MsgBox "当前没有任何记录", , "删除记录"
        Call txtvalue2      '//调用给文本框赋空值的过程
    End If
End If
End Sub

Private Sub Command4_Click()
Dim conn As New ADODB.Connection
conn.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=qygzgl"
Call value
'Adodc1.Recordset.Update
Call command5_click
MsgBox "数据已保存", , "保存成功"
'SSTab1.Tab = 0
Call state2
Call TxtState1

End Sub

Private Sub command5_click()
If Adodc1.Recordset.RecordCount <> 0 Then
    Adodc1.Recordset.MoveNext
    If Adodc1.Recordset.EOF Then
        Adodc1.Recordset.MoveFirst
    End If
    Call txtvalue1
Else
MsgBox "当前没有任何记录", , "移动记录"
End If
End Sub

Private Sub Command6_Click()
Adodc1.Refresh
MsgBox "请先保存,再进行其他操作!"
End Sub

Private Sub Command7_Click()
Dim sql As String
 Set DataReport4.DataSource = VSFlexGrid1.DataSource
 DataReport4.Show vbModal
End Sub
Private Sub txtvalue2()
DataCombo1.Text = Empty
'Text1.Text = Empty
'Text2.Text = Empty
'Text3.Text = Empty
'Text4.Text = Empty
Combo1.Text = Empty
Combo2.Text = Empty
DTPicker1.value = Data
DTPicker2.value = Data
Combo3.Text = Empty
Text5.Text = Empty
Text8.Text = Empty
Text6.Text = 0
Text9.Text = Empty
Text7.Text = 0
Text10.Text = Empty

Label21.Caption = Adodc1.Recordset.RecordCount
End Sub
Private Sub TxtState()
DataCombo1.Enabled = True
'Text1.Enabled = True
'Text2.Enabled = True
'Text3.Enabled = True
'Text4.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
DTPicker1.Enabled = True
DTPicker2.Enabled = True
Combo3.Enabled = True
Text5.Enabled = True
Text8.Enabled = True
Text6.Enabled = True
Text9.Enabled = True
Text7.Enabled = True
Text10.Enabled = True
End Sub
Private Sub state1()
Command1.Visible = False
Command2.Visible = False
Command3.Visible = False
Command4.Visible = True
Command5.Visible = False
Command6.Visible = True
Command8.Visible = False
End Sub
Private Sub state2()
Command1.Visible = True
Command2.Visible = True
Command3.Visible = True
Command4.Visible = False
Command5.Visible = True
Command6.Visible = False
Command8.Visible = True
End Sub
Private Sub txtvalue1()
DataCombo1.Text = Adodc1.Recordset.Fields(0).value
Text1.Text = Adodc1.Recordset.Fields(1).value
Text2.Text = Adodc1.Recordset.Fields(2).value
Text3.Text = Adodc1.Recordset.Fields(3).value
Text4.Text = Adodc1.Recordset.Fields(4).value
Combo1.Text = Adodc1.Recordset.Fields(5).value
Combo2.Text = Adodc1.Recordset.Fields(6).value
Combo3.Text = Adodc1.Recordset.Fields(9).value
Text5.Text = Adodc1.Recordset.Fields(10).value
Text8.Text = Adodc1.Recordset.Fields(11).value
Text6.Text = Adodc1.Recordset.Fields(12).value
Text9.Text = Adodc1.Recordset.Fields(13).value
Text7.Text = Adodc1.Recordset.Fields(14).value
Text10.Text = Adodc1.Recordset.Fields(15).value
'DTPicker1.value = Adodc1.Recordset.Fields(7).value
'DTPicker2.value = Adodc1.Recordset.Fields(8).value

Label21.Caption = Adodc1.Recordset.RecordCount

End Sub
Private Sub value()
Adodc1.Recordset.Fields(0).value = DataCombo1.Text
Adodc1.Recordset.Fields(1).value = Text1.Text
Adodc1.Recordset.Fields(2).value = Text2.Text
Adodc1.Recordset.Fields(3).value = Text3.Text
Adodc1.Recordset.Fields(4).value = Text4.Text
'Adodc1.Recordset.Fields(5).value = Combo1.Text
'Adodc1.Recordset.Fields(6).value = Combo2.Text
Adodc1.Recordset.Fields(7).value = DTPicker1.value
Adodc1.Recordset.Fields(8).value = DTPicker2.value
'Adodc1.Recordset.Fields(9).value = Combo3.Text
Adodc1.Recordset.Fields(10).value = Text5.Text
Adodc1.Recordset.Fields(11).value = Text8.Text
Adodc1.Recordset.Fields(12).value = Text6.Text
Adodc1.Recordset.Fields(13).value = Text9.Text
Adodc1.Recordset.Fields(14).value = Text7.Text
Adodc1.Recordset.Fields(15).value = Text10.Text
End Sub
Private Sub TxtState1()
DataCombo1.Enabled = False
'Text1.Enabled = False
'Text2.Enabled = False
'Text3.Enabled = False
'Text4.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = False
DTPicker1.Enabled = False
DTPicker2.Enabled = False
Combo3.Enabled = False
Text5.Enabled = False
Text8.Enabled = False
Text6.Enabled = False
Text9.Enabled = False
Text7.Enabled = False
Text10.Enabled = False
End Sub

Private Sub Command8_Click()
Unload Me
End Sub

Private Sub datacombo1_Change()
Dim conn As New ADODB.Connection
Dim rstc As New ADODB.Recordset
conn.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=qygzgl"
Dim sql As String
sql = "select * from 员工考勤 where 员工编号='" & DataCombo1.Text & "'"
rstc.CursorLocation = adUseClient
rstc.Open sql, conn
If rstc.RecordCount > 0 Then
'If rstc.State = adStateOpen Then
  '  rstc.Close
'End If
'rstc.Open "select * from 员工考勤 where 员工编号='" & DataCombo1.Text & "'", conn, adOpenKeyset, adLockOptimistic, adCmdText
    Text1.Text = rstc.Fields(1).value
    Text2.Text = rstc.Fields(2).value
    Text3.Text = rstc.Fields(3).value
    Text4.Text = rstc.Fields(4).value
End If
End Sub

Private Sub Form_Load()
SSTab1.Tab = 1
Dim conn As New ADODB.Connection
conn.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=qygzgl"
rsa.CursorLocation = adUseClient
If rsa.State = adStateOpen Then
 rsa.Open "员工考勤", conn, adOpenKeyset, adLockOptimistic, adCmdText
End If
'If rsa.RecordCount > 0 Then
'Call txtvalue1
'Else
'Call txtvalue2
'End If
Set DataCombo1.RowSource = rsa
DataCombo1.BoundColumn = "员工编号"
DataCombo1.ListField = "员工编号"

End Sub

⌨️ 快捷键说明

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