📄 frm_selectsql.frm
字号:
VERSION 5.00
Begin VB.Form Frm_SelectSql
Caption = "基本信息查询条件"
ClientHeight = 5160
ClientLeft = 60
ClientTop = 345
ClientWidth = 6795
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5160
ScaleWidth = 6795
StartUpPosition = 2 '屏幕中心
Begin VB.ListBox List4
Height = 420
Left = 120
TabIndex = 25
Top = 5850
Width = 1905
End
Begin VB.ListBox List3
Height = 420
Left = 4350
TabIndex = 24
Top = 5280
Width = 2235
End
Begin VB.ListBox List2
Height = 420
Left = 2190
TabIndex = 23
Top = 5280
Width = 1995
End
Begin VB.ListBox List1
Height = 420
Left = 90
TabIndex = 22
Top = 5280
Width = 1905
End
Begin VB.Frame Frame1
Height = 5055
Left = 60
TabIndex = 0
Top = 0
Width = 6615
Begin VB.CommandButton Cmd_Cancel
Caption = "取 消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 4260
TabIndex = 11
Top = 4260
Width = 1635
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 990
TabIndex = 10
Top = 4260
Width = 1635
End
Begin VB.Frame Frame2
Height = 1485
Left = 930
TabIndex = 9
Top = 2460
Width = 4995
Begin VB.ComboBox Combo4
Height = 300
Left = 2670
TabIndex = 20
Top = 780
Width = 1125
End
Begin VB.ComboBox Combo3
Height = 300
Left = 1110
TabIndex = 18
Top = 780
Width = 1125
End
Begin VB.ComboBox Combo2
Height = 300
Left = 2670
TabIndex = 15
Top = 360
Width = 1125
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1110
TabIndex = 13
Top = 360
Width = 1125
End
Begin VB.Label Label3
Caption = "月"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 3
Left = 3870
TabIndex = 21
Top = 840
Width = 225
End
Begin VB.Label Label3
Caption = "年"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 2
Left = 2340
TabIndex = 19
Top = 840
Width = 225
End
Begin VB.Label Label2
Caption = "到"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 1
Left = 690
TabIndex = 17
Top = 810
Width = 225
End
Begin VB.Label Label3
Caption = "月"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 1
Left = 3870
TabIndex = 16
Top = 420
Width = 225
End
Begin VB.Label Label3
Caption = "年"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 0
Left = 2340
TabIndex = 14
Top = 420
Width = 225
End
Begin VB.Label Label2
Caption = "从"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 0
Left = 690
TabIndex = 12
Top = 390
Width = 225
End
End
Begin VB.TextBox Text3
Height = 315
Left = 2940
TabIndex = 8
Top = 1680
Width = 2205
End
Begin VB.TextBox Text2
Height = 315
Left = 2940
TabIndex = 7
Top = 1290
Width = 2205
End
Begin VB.TextBox Text1
Height = 315
Left = 2940
TabIndex = 6
Top = 900
Width = 2205
End
Begin VB.CheckBox Check4
Caption = "进入本单位时间"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 900
TabIndex = 5
Top = 2040
Width = 1845
End
Begin VB.CheckBox Check3
Caption = "按部门名称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 900
TabIndex = 4
Top = 1650
Width = 1515
End
Begin VB.CheckBox Check2
Caption = "按职工姓名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 900
TabIndex = 3
Top = 1260
Width = 1515
End
Begin VB.CheckBox Check1
Caption = "按职工编号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 900
TabIndex = 2
Top = 870
Width = 1515
End
Begin VB.Label Label1
Caption = "选 择 查 询 条 件"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1440
TabIndex = 1
Top = 270
Width = 3975
End
End
End
Attribute VB_Name = "Frm_SelectSql"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
If Check1.Value = Checked Then
Text1.Enabled = True
sFieldName(0) = "SID"
Else
Text1.Enabled = False
sFieldName(0) = "SID"
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = Checked Then
Text2.Enabled = True
sFieldName(1) = "SName"
Else
Text2.Enabled = False
sFieldName(1) = "SName"
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = Checked Then
Text3.Enabled = True
sFieldName(2) = "SDept"
Else
Text3.Enabled = False
sFieldName(2) = "SDept"
End If
End Sub
Private Sub Check4_Click()
If Check4.Value = Checked Then
Combo1.Enabled = True
Combo2.Enabled = True
Combo3.Enabled = True
Combo4.Enabled = True
sFieldName(3) = "SInTime"
Else
Combo1.Enabled = False
Combo2.Enabled = False
Combo3.Enabled = False
Combo4.Enabled = False
sFieldName(3) = "SInTime"
End If
End Sub
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
Dim strSql As String
Dim BeginDate As String
Dim endDate As String
Dim sSql As String
If Check1.Value = Checked Then
List1.Clear
List1.AddItem sFieldName(0) & "='" & Trim(Text1.Text) & "' and"
Else
List1.Clear
End If
If Check2.Value = Checked Then
List2.Clear
List2.AddItem sFieldName(1) & "='" & Trim(Text2.Text) & "' and"
Else
List2.Clear
End If
If Check3.Value = Checked Then
List3.Clear
List3.AddItem sFieldName(2) & "='" & Trim(Text3.Text) & "' and"
Else
List3.Clear
End If
If Check4.Value = Checked Then
List4.Clear
BeginDate = Trim(Combo1.Text) & "年" & Trim(Combo2.Text) & "月01日"
endDate = Trim(Combo3.Text) & "年" & Trim(Combo4.Text) & "月01日"
List4.AddItem "(" & Trim(sFieldName(3)) & " Between '" & Trim(BeginDate) & "' and '" & Trim(endDate) & "') and "
Else
List4.Clear
End If
If Check4.Value = Checked Then
strSql = "Select * From StuffInfo Where " & Trim(List1.List(0)) & " " & Trim(List2.List(0)) & " " & Trim(List3.List(0)) & " " & Trim(List4.List(0))
sSql = Mid(strSql, 1, Len(strSql) - 6)
Else
If Check3.Value = Unchecked Then
'''MsgBox "ddddd"
strSql = "Select * From StuffInfo Where " & Trim(List1.List(0)) & " " & Trim(List2.List(0)) & " " & Trim(List3.List(0)) & " '"
sSql = Mid(strSql, 1, Len(strSql) - 9)
Else
''MsgBox "sdsssd"
strSql = "Select * From StuffInfo Where " & Trim(List1.List(0)) & " " & Trim(List2.List(0)) & " " & Trim(List3.List(0))
sSql = Mid(strSql, 1, Len(strSql) - 4)
End If
End If
'''MsgBox sSql
InfoSql = sSql
Frm_InfoFind.Show 1
End Sub
Private Sub Form_Load()
Dim i As Integer
'''''初始化''''''''''''
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = False
Combo3.Enabled = False
Combo4.Enabled = fasle
''''''''''''
For i = 1990 To 2020
Combo1.AddItem Trim(Str(i))
Combo3.AddItem Trim(Str(i))
Next i
For i = 1 To 12
If i < 10 Then
Combo2.AddItem "0" & Trim(Str(i))
Combo4.AddItem "0" & Trim(Str(i))
Else
Combo2.AddItem Trim(Str(i))
Combo4.AddItem Trim(Str(i))
End If
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -