📄 gzcx.frm
字号:
ColumnWidth = 659.906
EndProperty
BeginProperty Column06
ColumnWidth = 540.284
EndProperty
BeginProperty Column07
ColumnWidth = 615.118
EndProperty
BeginProperty Column08
ColumnWidth = 720
EndProperty
BeginProperty Column09
ColumnWidth = 824.882
EndProperty
BeginProperty Column10
ColumnWidth = 810.142
EndProperty
BeginProperty Column11
ColumnWidth = 810.142
EndProperty
BeginProperty Column12
ColumnWidth = 705.26
EndProperty
EndProperty
End
Begin VB.CommandButton Command2
Caption = "打印(&P)"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2760
TabIndex = 5
Top = 120
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "查询(&Q)"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 840
TabIndex = 4
Top = 120
Width = 1215
End
Begin VB.Frame Frame1
Height = 1575
Left = 120
TabIndex = 0
Top = 720
Width = 6495
Begin MSDataListLib.DataCombo DataCombo1
Height = 330
Left = 4680
TabIndex = 13
Top = 360
Width = 1455
_ExtentX = 2566
_ExtentY = 582
_Version = 393216
Text = ""
End
Begin VB.TextBox Text2
Height = 390
Left = 3000
TabIndex = 12
Top = 960
Width = 1455
End
Begin VB.OptionButton Option3
Caption = "Option3"
Height = 180
Left = 1680
TabIndex = 11
Top = 1080
Width = 255
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 255
Left = 3360
TabIndex = 9
Top = 480
Width = 255
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 255
Left = 120
TabIndex = 8
Top = 480
Width = 255
End
Begin VB.TextBox Text1
Height = 390
Left = 1440
TabIndex = 7
Top = 360
Width = 1335
End
Begin VB.Label Label3
Caption = "计发时间:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1920
TabIndex = 3
Top = 1080
Width = 1215
End
Begin VB.Label Label2
Caption = "所在部门:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3600
TabIndex = 2
Top = 480
Width = 1215
End
Begin VB.Label Label1
Caption = "员工编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 1
Top = 480
Width = 1215
End
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "条"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2880
TabIndex = 16
Top = 5040
Width = 285
End
Begin VB.Label Label5
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2400
TabIndex = 15
Top = 5040
Width = 375
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "当前查询记录共:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 120
TabIndex = 14
Top = 5040
Width = 2280
End
End
Attribute VB_Name = "gzcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Private Sub Adodc1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
'Adodc1.Caption = "当前查询记录共:" & Adodc1.Recordset.AbsolutePosition & Space(3) & "记录总数:" & Adodc1.Recordset.RecordCount
'End Sub
Private Sub Command1_Click()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
conn.Open "DSN=qygzgl"
Dim sql As String
If Option1.value = True Then
sql = "select * from 员工工资表 where 员工编号='" & Text1.Text & "'"
Else
If Option2.value = True Then
sql = "select * from 员工工资表 where 所在部门='" & DataCombo1.Text & "'"
Else
sql = "select * from 员工工资表 where 计发时间='" & Text2.Text & "'"
End If
End If
rs.CursorLocation = adUseClient
rs.Open sql, conn
Set DataGrid1.DataSource = rs
If rs.RecordCount = 0 Then
MsgBox ("没有符合条件的记录!")
End If
End Sub
Private Sub Command2_Click()
Dim sql As String
Set DataReport3.DataSource = DataGrid1.DataSource
DataReport3.Show
End Sub
Private Sub command3_click()
Unload Me
End Sub
Private Sub Form_Load()
Dim conn As New ADODB.Connection
conn.Open "DSN=qygzgl"
'rs1.CursorLocation = adUseClient
If rs1.State = adStateClosed Then
rs1.Open "部门管理", conn, adOpenKeyset, adLockPessimistic, adCmdTable
End If
Set DataCombo1.RowSource = rs1
DataCombo1.BoundColumn = "部门名称"
DataCombo1.ListField = "部门名称"
End Sub
Private Sub Option1_Click()
Text1.Text = ""
Text2.Text = ""
DataCombo1.Text = ""
Text1.SetFocus
End Sub
Private Sub Option2_Click()
Text1.Text = ""
Text2.Text = ""
DataCombo1.Text = ""
DataCombo1.SetFocus
End Sub
Private Sub Option3_Click()
Text1.Text = ""
Text2.Text = ""
DataCombo1.Text = ""
Text2.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -