frmgzqkcc.frm
来自「企业工资管理系统的具体实现」· FRM 代码 · 共 779 行 · 第 1/2 页
FRM
779 行
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin VB.Frame Frame1
Height = 1620
Left = 60
TabIndex = 1
Top = 330
Visible = 0 'False
Width = 11715
Begin VB.Frame Frame3
Height = 840
Left = 9060
TabIndex = 15
Top = 150
Width = 1575
Begin VB.OptionButton Option2
Caption = "产品"
Height = 210
Left = 240
TabIndex = 17
Top = 510
Width = 660
End
Begin VB.OptionButton Option1
Caption = "班次"
Height = 210
Left = 240
TabIndex = 16
Top = 180
Value = -1 'True
Width = 660
End
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 375
Left = 9780
TabIndex = 14
Top = 1155
Width = 1185
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 345
Left = 6615
TabIndex = 13
Text = "Text2"
Top = 615
Width = 1935
End
Begin VB.CheckBox Check3
Caption = "姓 名:"
Height = 300
Left = 5295
TabIndex = 12
Top = 660
Width = 1200
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 345
Left = 2055
TabIndex = 11
Text = "Text1"
Top = 615
Width = 2505
End
Begin VB.CheckBox Check2
Caption = "工人代号:"
Height = 405
Left = 795
TabIndex = 10
Top = 585
Width = 1215
End
Begin VB.CheckBox Check1
Caption = "车间代号:"
Height = 360
Left = 5265
TabIndex = 9
Top = 225
Width = 1200
End
Begin VB.ComboBox Combo2
Enabled = 0 'False
Height = 300
Left = 6585
TabIndex = 8
Text = "Combo2"
Top = 240
Width = 2190
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "frmgzqkcc.frx":030A
Left = 2055
List = "frmgzqkcc.frx":0332
TabIndex = 6
Text = "01月"
Top = 240
Width = 1305
End
Begin VB.CommandButton Command2
Caption = "全部查询"
Height = 375
Left = 8580
TabIndex = 3
Top = 1155
Width = 1185
End
Begin VB.CommandButton Command1
Caption = "选择查询"
Height = 375
Left = 7365
TabIndex = 2
Top = 1155
Width = 1185
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "时 间:"
Height = 180
Left = 1065
TabIndex = 7
Top = 315
Width = 900
End
End
Begin MSComctlLib.TabStrip TabStrip1
Height = 7245
Left = -15
TabIndex = 0
Top = 0
Width = 11865
_ExtentX = 20929
_ExtentY = 12779
MultiRow = -1 'True
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 2
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "工作正常查询"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "工作额外查询"
ImageVarType = 2
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmgzqkcc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
If Check1.Value = 1 Then
Combo2.Enabled = True
Else
Combo2.Enabled = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
Text1.Enabled = True
Else
Text1.Enabled = False
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = 1 Then
Text2.Enabled = True
Else
Text2.Enabled = False
End If
End Sub
Private Sub Check4_Click()
If Check4.Value = 1 Then
Combo3.Enabled = True
Else
Combo3.Enabled = False
End If
End Sub
Private Sub Check5_Click()
If Check5.Value = 1 Then
Text4.Enabled = True
Else
Text4.Enabled = False
End If
End Sub
Private Sub Check6_Click()
'If Check6.Value = 1 Then
' Text3.Enabled = True
'Else
' Text3.Enabled = False
'End If
End Sub
Private Sub Command1_Click()
Dim sql As String
sql = "select cjdh as 车间代号,grdh as 工人代号,xm as 姓名"
If Option1.Value = True Then
other = ",cx as 出席"
For i = 1 To 31
other = other & ",bc" & Trim(Str$(i)) & " as " & Trim(Str$(i)) & "日"
Next i
ElseIf Option2.Value = True Then
other = ",cpjs as 产品件数"
For i = 1 To 31
other = other & ",cp" & Trim(Str$(i)) & " as " & Trim(Str$(i)) & "日"
Next i
End If
sql = sql & other & " from sbqkb" & Left(Trim(Combo1.Text), 2)
If Check1.Value = 1 Then sql = sql & " where cjdh='" & Trim(Combo2.Text) & "'"
If Check1.Value = 1 Then
If Check2.Value = 1 Then
sql = sql & " and grdh='" & Trim(Text1.Text) & "'"
End If
Else
If Check2.Value = 1 Then sql = sql & " where grdh='" & Trim(Text1.Text) & "'"
End If
If Check1.Value = 1 Then
If Check3.Value = 1 Then
sql = sql & " and xm='" & Trim(Text2.Text) & "'"
End If
Else
If Check2.Value = 1 Then
If Check3.Value = 1 Then sql = sql & " and xm='" & Trim(Text2.Text) & "'"
Else
If Check3.Value = 1 Then sql = sql & " where xm='" & Trim(Text2.Text) & "'"
End If
End If
With Adodc2
.ConnectionString = constr
.RecordSource = sql
.Refresh
End With
End Sub
Private Sub Command2_Click()
If Option1.Value = True Then
other = ",cx as 出席"
For i = 1 To 31
other = other & ",bc" & Trim(Str$(i)) & " as " & Trim(Str$(i)) & "日"
Next i
ElseIf Option2.Value = True Then
other = ",cpjs as 产品件数"
For i = 1 To 31
other = other & ",cp" & Trim(Str$(i)) & " as " & Trim(Str$(i)) & "日"
Next i
End If
With Adodc2
.ConnectionString = constr
.RecordSource = "select cjdh as 车间代号,grdh as 工人代号,xm as 姓名" & other & " from sbqkb" & Left(Trim(Combo1.Text), 2)
.Refresh
End With
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
'Dim cnn As New ADODB.Recordset
Dim sql As String
sql = "select yf as 月份,cjdh as 车间代号,grdh as 工人代号,"
If Option3.Value = True Then
sql = sql & "cdsj as 迟到时间"
ElseIf Option4.Value = True Then
sql = sql & "cpkc as 次品扣除"
ElseIf Option5.Value = True Then
sql = sql & "jbsj as 加班时间"
ElseIf Option6.Value = True Then
sql = sql & "qx as 缺席"
End If
sql = sql & ",qtkc as 其它扣除,bz as 备注 from gzkcb where yf='" & Trim(Combo4.Text) & "'"
If Check4.Value = 1 Then sql = sql & " and cjdh='" & Trim(Combo3.Text) & "'"
If Check5.Value = 1 Then sql = sql & " and grdh='" & Trim(Text4.Text) & "'"
'If Check6.Value = 1 Then sql = sql & " and xm='" & Trim(Text3.Text) & "'"
With Adodc1
.ConnectionString = constr
.RecordSource = sql
.Refresh
End With
End Sub
Private Sub Command5_Click()
With Adodc1
.ConnectionString = constr
.RecordSource = "select yf as 月份,cjdh as 车间代号,grdh as 工人代号,qx as 缺席,cdsj as 迟到时间,jbsj as 加班时间,cpkc as 次品扣除,qtkc as 其它扣除,bz as 备注 from gzkcb"
.Refresh
End With
Set DataGrid2.DataSource = Adodc1
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim cnn As New ADODB.Recordset
Dim other As String
With cnn
.ActiveConnection = constr
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockPessimistic
.Open "select distinct(yf) from gzkcb"
If Not (.EOF And .BOF) Then .MoveFirst
Do While Not .EOF
Combo4.AddItem .Fields("yf").Value
.MoveNext
Loop
.Close
End With
Set cnn = Nothing
Combo4.Text = Combo4.List(0)
With cnn
.ActiveConnection = constr
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockPessimistic
.Open "select * from cjb"
If Not (.EOF And .BOF) Then .MoveFirst
Do While Not .EOF
Combo3.AddItem .Fields("cjdh").Value
Combo2.AddItem .Fields("cjdh").Value
.MoveNext
Loop
.Close
End With
Set cnn = Nothing
Combo3.Text = Combo3.List(0)
Combo2.Text = Combo2.List(0)
With Adodc1
.ConnectionString = constr
.RecordSource = "select yf as 月份,cjdh as 车间代号,grdh as 工人代号,qx as 缺席,cdsj as 迟到时间,jbsj as 加班时间,cpkc as 次品扣除,qtkc as 其它扣除,bz as 备注 from gzkcb"
.Refresh
End With
Set DataGrid2.DataSource = Adodc1
If Option1.Value = True Then
other = ",cx as 出席"
For i = 1 To 31
other = other & ",bc" & Trim(Str$(i)) & " as " & Trim(Str$(i)) & "日"
Next i
ElseIf Option2.Value = True Then
other = ",cpjs as 产品件数"
For i = 1 To 31
other = other & ",cp" & Trim(Str$(i)) & " as " & Trim(Str$(i)) & "日"
Next i
End If
With Adodc2
.ConnectionString = constr
.RecordSource = "select cjdh as 车间代号,grdh as 工人代号,xm as 姓名" & other & " from sbqkb" & Left(Trim(Combo1.Text), 2)
.Refresh
End With
Set DataGrid1.DataSource = Adodc2
End Sub
Private Sub TabStrip1_Click()
If TabStrip1.SelectedItem = "工作正常查询" Then
Frame1.Visible = True
Frame2.Visible = True
Frame4.Visible = False
Frame6.Visible = False
Else
Frame1.Visible = False
Frame2.Visible = False
Frame4.Visible = True
Frame6.Visible = True
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?