📄 frmrlzyxxcx.frm
字号:
Caption = " 按工作状态查询"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Index = 1
Left = 600
TabIndex = 6
Top = 3120
Width = 2295
End
Begin VB.OptionButton Option2
Caption = " 按部门查询"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Index = 0
Left = 600
TabIndex = 5
Top = 1320
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "打 印"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 1920
Picture = "frmRLZYXXCX.frx":192D
Style = 1 'Graphical
TabIndex = 4
Top = 5280
Width = 975
End
Begin VB.CommandButton Command1
BackColor = &H00C00000&
Caption = "查 询"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 360
Picture = "frmRLZYXXCX.frx":2452
Style = 1 'Graphical
TabIndex = 3
Top = 5280
Width = 1095
End
Begin VB.TextBox Text1
BackColor = &H00FFC0C0&
Height = 315
Index = 1
Left = 720
TabIndex = 2
Top = 4560
Width = 1815
End
Begin VB.Label Label5
Caption = "请输入要查询的关键字:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Index = 1
Left = 480
TabIndex = 1
Top = 3960
Width = 2415
End
End
End
Attribute VB_Name = "frmRLZYXXCX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Command1_Click(Index As Integer)
If Option6.Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 人力资源查询 where 姓名 like " & "'%" & Text1(1).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option2(0).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 人力资源查询 where 部门 like " & "'%" & Text1(1).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option2(2).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 人力资源查询 where 职务 like " & "'%" & Text1(1).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option2(3).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 人力资源查询 where 职称 like " & "'%" & Text1(1).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option2(1).Value = True Then
On Error Resume Next
rs.Close
rs.Open "select * from 人力资源查询 where 工作状态 like " & "'%" & Text1(1).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
End Sub
Private Sub Command3_Click()
If Text3(0) = "" Then
MsgBox "姓名不能为空!", vbExclamation, "提示"
ElseIf Text3(1) = "" Then
MsgBox "职务不能为空!", vbExclamation, "提示"
ElseIf Text2(0) = "" Then
MsgBox "工作证号不能为空!", vbExclamation, "提示"
ElseIf Text2(2) = "" Then
MsgBox "学历或同等学历不能为空!", vbExclamation, "提示"
End If
'GoTo er
If Option1(0).Value = False And Option1(1).Value = False And Option1(2).Value = False And Option1(3).Value = False Then
MsgBox "选择工作记录"
GoTo er
End If
If Option7.Value = False And Option8.Value = False And Option9.Value = False And Option10.Value = False Then
MsgBox "请选择工作表现"
GoTo er
End If
If Option1(0).Value = False And Option11.Value = False And Option12.Value = False And Option13.Value = False And Option14.Value = False And Option15.Value = False And Option16.Value = False Then
MsgBox "请选择考勤记录"
GoTo er
End If
rs.Open "insert into 人力资源查询(姓名,性别,年龄,工作时间,职称,职务,工作证号,学力或同等学历,工作经历)values('" & Trim(Text3(0).Text) & "','" & Trim(Text3(5).Text) & "','" & Trim(Text3(4).Text) & "','" & Trim(Text3(3).Text) & "','" & Trim(Text3(2).Text) & "','" & Trim(Text3(1).Text) & "','" & Trim(Text2(0).Text) & "','" & Trim(Text2(2).Text) & "','" & Trim(Text2(1).Text) & "')", db, adOpenStatic, adLockReadOnly
Text3(0) = ""
Text3(5) = ""
Text3(4) = ""
Text3(3) = ""
Text3(2) = ""
Text3(1) = ""
Text2(0) = ""
Text2(2) = ""
Text2(1) = ""
Text3(0).SetFocus
er:
End Sub
Private Sub Command4_Click()
On Error Resume Next
rs.Close
rs.Open "select * from BOM where 编号='" & Combo1.Text & "'", db, adOpenStatic, adLockReadOnly
Text3(0).Text = Trim(rs.Fields("物料名称").Value)
Text3(1).Text = Trim(rs.Fields("品名").Value)
Text3(2).Text = Trim(rs.Fields("类型").Value)
Text3(3).Text = Trim(rs.Fields("规格").Value)
Text3(4).Text = Trim(rs.Fields("厂商编号").Value)
Text3(5).Text = Trim(rs.Fields("单位").Value)
Text3(6).Text = Trim(rs.Fields("单价").Value)
Text3(7).Text = Trim(rs.Fields("币种").Value)
Text3(8).Text = Trim(rs.Fields("库存").Value)
Text3(9).Text = 0
End Sub
Private Sub Command5_Click()
'rs.Close
rs.Open "delete 人力资源查询 where 姓名='" & Trim(Text3(0).Text) & "'", db, adOpenStatic, adLockReadOnly
End Sub
Private Sub Command6_Click()
rs.Close
rs.Open "select * from 人力资源查询", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Command7_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.ConnectionString = "driver={SQL Server};server=MAINSRV;database=物流系统"
db.Open
rs.Open "select * from 人力资源查询", db, adOpenStatic, adLockReadOnly
Me.Hide
frmRLZYXXCX.Show
With Adodc1
.ConnectionString = "driver={SQL Server};server=MAINSRV;database=物流系统"
.RecordSource = "select * from 人力资源查询"
End With
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Me.Hide
MDIPSZX.Show
End Sub
Private Sub Option2_Click(Index As Integer)
'On Error Resume Next
rs.Close
rs.Open "select * from 人力资源查询 where 职务 like " & "'%" & Text1(1).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End Sub
Private Sub Option6_Click()
'Select Case Option2()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -