📄 frmsearch2.frm
字号:
BeginProperty Column18
DataField = "其他扣款"
Caption = "其他扣款"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column19
DataField = "个人所得税"
Caption = "个人所得税"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column20
DataField = "实发金额"
Caption = "实发金额"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column21
DataField = "年份"
Caption = "年份"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column22
DataField = "月份"
Caption = "月份"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column23
DataField = "操作时间"
Caption = "操作时间"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column24
DataField = "备注"
Caption = "备注"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 870.236
EndProperty
BeginProperty Column01
ColumnWidth = 854.929
EndProperty
BeginProperty Column02
ColumnWidth = 1214.929
EndProperty
BeginProperty Column03
ColumnWidth = 1244.976
EndProperty
BeginProperty Column04
ColumnWidth = 720
EndProperty
BeginProperty Column05
ColumnWidth = 840.189
EndProperty
BeginProperty Column06
ColumnWidth = 854.929
EndProperty
BeginProperty Column07
ColumnWidth = 884.976
EndProperty
BeginProperty Column08
ColumnWidth = 1005.165
EndProperty
BeginProperty Column09
ColumnWidth = 810.142
EndProperty
BeginProperty Column10
ColumnWidth = 540.284
EndProperty
BeginProperty Column11
ColumnWidth = 884.976
EndProperty
BeginProperty Column12
ColumnWidth = 854.929
EndProperty
BeginProperty Column13
ColumnWidth = 870.236
EndProperty
BeginProperty Column14
ColumnWidth = 900.284
EndProperty
BeginProperty Column15
ColumnWidth = 900.284
EndProperty
BeginProperty Column16
ColumnWidth = 810.142
EndProperty
BeginProperty Column17
ColumnWidth = 900.284
EndProperty
BeginProperty Column18
ColumnWidth = 945.071
EndProperty
BeginProperty Column19
ColumnWidth = 1080
EndProperty
BeginProperty Column20
ColumnWidth = 929.764
EndProperty
BeginProperty Column21
ColumnWidth = 569.764
EndProperty
BeginProperty Column22
ColumnWidth = 599.811
EndProperty
BeginProperty Column23
ColumnWidth = 900.284
EndProperty
BeginProperty Column24
ColumnWidth = 1005.165
EndProperty
EndProperty
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmSearch2.frx":0015
Height = 1935
Left = 240
TabIndex = 1
Top = 360
Width = 9255
_ExtentX = 16325
_ExtentY = 3413
_Version = 393216
BackColor = 16777215
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = "部门编号"
Caption = "部门编号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "部门名称"
Caption = "部门名称"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 2085.166
EndProperty
BeginProperty Column01
ColumnWidth = 2085.166
EndProperty
EndProperty
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "部门名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5880
TabIndex = 7
Top = 5160
Width = 1335
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "部门编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2880
TabIndex = 5
Top = 5160
Width = 1215
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "请输入查询的条件:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 4
Top = 5160
Width = 2175
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "查询结果:"
BeginProperty Font
Name = "隶书"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 2
Top = 1920
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "所有部门:"
BeginProperty Font
Name = "隶书"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 0
Top = 120
Width = 1575
End
End
Attribute VB_Name = "frmSearch2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim flag As Integer
Private Sub cxchenggong()
Label2.Visible = True
DataGrid2.Visible = True
'Adodc2.RecordSource = " select * from 职工工资明细表 where 员工编号='" & Adodc1.Recordset.Fields("员工编号").Value & ""
'Adodc2.RecordSource = " select * from 职工工资明细表 where 所属部门编号='" & Text1.Text & "'"
'Adodc2.Refresh
If flag = 1 Then Adodc2.RecordSource = " select * from 职工工资结算表 where 所属部门编号='" & Text1.Text & "'"
If flag = 2 Then Adodc2.RecordSource = " select * from 职工工资结算表 where 所属部门名称='" & Text2.Text & "'"
If flag = 3 Then Adodc2.RecordSource = " select * from 职工工资结算表 where 所属部门编号='" & Text1.Text & "' and 所属部门名称='" & Text2.Text & "'"
Adodc2.Refresh
End Sub
Private Sub Command1_Click()
On Error GoTo chaxunerr
DataGrid1.Height = 500
DataGrid1.Top = 480
Dim i
i = 0
flag = 0
If Text1.Text <> "" And Text2.Text = "" Then
'部门编号查询
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF <> True
If Text1.Text = Adodc1.Recordset.Fields("部门编号").Value Then
i = 1
flag = 1
Exit Do
End If
Adodc1.Recordset.MoveNext
Loop
ElseIf Text1.Text = "" And Text2.Text <> "" Then
'部门名称查询
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF <> True
If Text2.Text = Adodc1.Recordset.Fields("部门名称").Value Then
i = 1
flag = 2
Exit Do
End If
Adodc1.Recordset.MoveNext
Loop
Else
'部门编号和部门名称查询
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF <> True
If Text1.Text = Adodc1.Recordset.Fields("部门编号").Value _
And Text2.Text = Adodc1.Recordset.Fields("部门名称").Value Then
i = 1
flag = 3
Exit Do
End If
Adodc1.Recordset.MoveNext
Loop
End If
chaxunerr:
If i = 1 Then
DataGrid1.BackColor = &HC0E0FF
chenggong = MsgBox("查询成功!", vbOKOnly + vbExclamation, "查询")
If chenggong = 1 Then
Call cxchenggong
End If
Else:
DataGrid1.Height = 3255
DataGrid1.Top = 480
MsgBox "查无此记录!", vbOKOnly + vbExclamation, "提示"
End If
End Sub
Private Sub Command2_Click()
'DataGrid1.BackColor = &HFFFFFF
DataGrid2.Visible = False
DataGrid1.Height = 3255
DataGrid1.Top = 480
Adodc1.Recordset.MoveFirst
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Me.Hide
Unload Me
Exit Sub
End Sub
Private Sub Form_Activate()
Label2.Visible = False
DataGrid2.Visible = False
Adodc1.Recordset.MoveFirst
DataGrid1.Height = 2500
DataGrid1.Top = 480
'DataGrid1.BackColor = &HFFFFFF
'Command2.Enabled = False
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -