📄 frm_gongzi_query.frm
字号:
VERSION 5.00
Begin VB.Form Frm_gongzi_query
BorderStyle = 1 'Fixed Single
Caption = "工资查询"
ClientHeight = 1725
ClientLeft = 4590
ClientTop = 3585
ClientWidth = 3420
Icon = "Frm_gongzi_query.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1725
ScaleWidth = 3420
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text1
Height = 300
Left = 1140
TabIndex = 2
Top = 360
Width = 2055
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 480
TabIndex = 1
Top = 1140
Width = 975
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 1920
TabIndex = 0
Top = 1140
Width = 975
End
Begin VB.Label Label2
Caption = "职工姓名"
Height = 255
Left = 240
TabIndex = 3
Top = 420
Width = 795
End
End
Attribute VB_Name = "Frm_gongzi_query"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim cn As ADODB.Connection
On Error GoTo myerr
Dim rst As New ADODB.Recordset
Dim sql As String
Dim lt As ListItem
Set cn = GetCn
sql = "select zgh,xm,jb,jn,jj,kk,sf,id from gongzi where a.xm like '%" & Trim(Text1) & "% order by zgh'"
rst.Open sql, cn, 0, 1
Frm_zhigong.ListView1.ListItems.Clear
If rst.BOF And rst.EOF Then
MsgBox "没有符合条件的记录!", vbExclamation, "提示"
Exit Sub
End If
Do While Not rst.EOF
Set lt = Frm_gongzi.ListView1.ListItems.Add(, , rst(0), 7, 7)
For i = 1 To rst.Fields.Count - 1
lt.SubItems(i) = Trim(rst(i) & "")
Next i
rst.MoveNext
Loop
rst.Close
cn.Close
Unload Me
Exit Sub
myerr:
If Err = -2147217904 Then
If rst.State = 1 Then rst.Close
rst.Open "select count(*) from gongzi", cn, 0, 1
If rst(0) = 0 Then
Unload Me
Exit Sub
Else
MsgBox Error, vbExclamation, "提示"
End If
Else
MsgBox Error, vbExclamation, "提示"
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -