📄 form2.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Form2
Caption = "人员基本信息查询"
ClientHeight = 6795
ClientLeft = 60
ClientTop = 345
ClientWidth = 7785
LinkTopic = "Form2"
ScaleHeight = 6795
ScaleWidth = 7785
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退 出"
Height = 615
Left = 6000
TabIndex = 21
Top = 4080
Width = 1335
End
Begin VB.Frame Frame1
Height = 3375
Left = 960
TabIndex = 8
Top = 1560
Width = 4815
Begin VB.TextBox Text5
Height = 375
Left = 2760
TabIndex = 20
Top = 2760
Width = 1335
End
Begin VB.TextBox Text4
Height = 375
Left = 2760
TabIndex = 19
Top = 1920
Width = 1335
End
Begin VB.TextBox Text3
Height = 375
Left = 2760
TabIndex = 16
Top = 1080
Width = 1335
End
Begin VB.TextBox Text2
Height = 375
Left = 2760
TabIndex = 14
Top = 240
Width = 1335
End
Begin VB.CheckBox Check4
Height = 255
Left = 240
TabIndex = 12
Top = 2820
Width = 255
End
Begin VB.CheckBox Check3
Height = 255
Left = 240
TabIndex = 11
Top = 1980
Width = 255
End
Begin VB.CheckBox Check2
Height = 255
Left = 240
TabIndex = 10
Top = 1140
Width = 255
End
Begin VB.CheckBox Check1
Height = 255
Left = 240
TabIndex = 9
Top = 300
Width = 255
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "性 别"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 870
TabIndex = 18
Top = 2850
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "具体科室"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 870
TabIndex = 17
Top = 2040
Width = 960
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "职称名称"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 870
TabIndex = 15
Top = 1200
Width = 960
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "人员姓名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 870
TabIndex = 13
Top = 360
Width = 960
End
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 255
Left = 360
TabIndex = 7
Top = 3000
Width = 210
End
Begin VB.TextBox Text1
Height = 375
Left = 3720
TabIndex = 5
Top = 960
Width = 1335
End
Begin VB.OptionButton Option1
Height = 255
Left = 360
TabIndex = 4
Top = 1080
Value = -1 'True
Width = 255
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 1095
Left = 360
TabIndex = 3
Top = 5280
Width = 7215
_ExtentX = 12726
_ExtentY = 1931
_Version = 393216
HeadLines = 1
RowHeight = 15
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
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 6000
Top = 6120
Visible = 0 'False
Width = 1320
_ExtentX = 2328
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\佳音vb1\RSGL.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\佳音vb1\RSGL.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "清 除"
Height = 615
Left = 6000
TabIndex = 1
Top = 2640
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "确 定"
Height = 615
Left = 6000
TabIndex = 0
Top = 1200
Width = 1335
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请输入人员编号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1320
TabIndex = 6
Top = 1080
Width = 1680
End
Begin VB.Label Label3
Caption = "可以用以下任意方式查询"
BeginProperty Font
Name = "幼圆"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 720
TabIndex = 2
Top = 240
Width = 3495
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Option2.Value = True Then
If Text2.Text = "" And Text3.Text = "" And Text4.Text = "" And Text5.Text = "" Then
a = MsgBox("所有复选查询条件不能全为空", , "错误!")
Else
m = "select * from 人事基本信息表 where "
If Check1.Value = 1 Then
m = m & "人员姓名='" & Text2.Text & "'"
End If
If Check2.Value = 1 Then
If Check1.Value = 0 Then
m = m & "职称名称='" & Text3.Text & "'"
Else
m = m & " and 职称名称='" & Text3.Text & "'"
End If
End If
If Check3.Value = 1 Then
If Check1.Value = 0 And Check2.Value = 0 Then
m = m & "具体科室='" & Text4.Text & "'"
Else
m = m & " and 具体科室='" & Text4.Text & "'"
End If
End If
If Check4.Value = 1 Then
If Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 0 Then
m = m & "性别='" & Text5.Text & "'"
Else
m = m & " and 性别='" & Text5.Text & "'"
End If
End If
Adodc1.RecordSource = m
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
a = MsgBox("不存在此项纪录!", , "错误!")
Else
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
DataGrid1.Visible = True
End If
End If
ElseIf Option1.Value = True Then
Adodc1.RecordSource = "select * from 人事基本信息表 where 人员编号='" & Text1.Text & "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
a = MsgBox("不存在此项纪录!", , "错误!")
Else
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
DataGrid1.Visible = True
End If
Else
If Text1.Text = "" And Text2.Text = "" And Text3.Text = "" And Text4.Text = "" And Text5.Text = "" Then
a = MsgBox("所有查询条件不能全为空", , "错误!")
End If
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Form2.Left = 1600
Form2.Top = 800
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
Text1.Enabled = True
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Frame1.Enabled = False
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
Frame1.Enabled = True
Text1.Text = ""
Text1.Enabled = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -