📄 frmquery.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FrmQuery
BackColor = &H80000013&
BorderStyle = 1 'Fixed Single
Caption = "信息查询系统"
ClientHeight = 5565
ClientLeft = 3825
ClientTop = 3210
ClientWidth = 6120
Icon = "FrmQuery.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5565
ScaleWidth = 6120
Begin VB.CommandButton Command3
Caption = "按编号查找"
Height = 420
Left = 2445
TabIndex = 19
Top = 4905
Width = 1230
End
Begin VB.Frame Frame1
BackColor = &H80000013&
Caption = "查询条件"
Height = 3585
Left = 533
TabIndex = 0
Top = 990
Width = 5055
Begin VB.CheckBox Check5
BackColor = &H80000013&
Caption = "婚姻状况"
Height = 195
Left = 270
TabIndex = 26
Top = 3150
Width = 1050
End
Begin VB.Frame Frame3
BackColor = &H80000013&
Enabled = 0 'False
Height = 555
Left = 1350
TabIndex = 23
Top = 2925
Width = 3165
Begin VB.OptionButton Option3
BackColor = &H80000013&
Caption = "未婚"
Height = 195
Left = 135
TabIndex = 25
Top = 225
Width = 690
End
Begin VB.OptionButton Option4
BackColor = &H80000013&
Caption = "离婚或丧偶"
Height = 195
Left = 1170
TabIndex = 24
Top = 225
Width = 1320
End
End
Begin VB.Frame Frame2
BackColor = &H80000013&
Height = 555
Left = 1350
TabIndex = 20
Top = 135
Width = 3300
Begin VB.OptionButton Option1
BackColor = &H80000013&
Caption = "男"
Height = 195
Left = 495
TabIndex = 22
Top = 225
Value = -1 'True
Width = 825
End
Begin VB.OptionButton Option2
BackColor = &H80000013&
Caption = "女"
Height = 240
Left = 1710
TabIndex = 21
Top = 225
Width = 915
End
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 330
Left = 3105
TabIndex = 17
Top = 2475
Width = 1410
_ExtentX = 2487
_ExtentY = 582
_Version = 393216
Enabled = 0 'False
Format = 58851329
CurrentDate = 38578
End
Begin VB.TextBox txtAge1
Height = 330
Left = 1350
TabIndex = 13
Top = 780
Width = 1275
End
Begin VB.TextBox TxtAera
Height = 330
Left = 1350
TabIndex = 12
Top = 1935
Width = 2895
End
Begin VB.TextBox txtAge2
Height = 330
Left = 3375
TabIndex = 11
Top = 780
Width = 1050
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 330
Left = 1350
TabIndex = 10
Top = 2475
Width = 1410
_ExtentX = 2487
_ExtentY = 582
_Version = 393216
Enabled = 0 'False
Format = 58851329
CurrentDate = 38578
End
Begin VB.CheckBox Check4
BackColor = &H80000013&
Caption = "入会时间"
Height = 240
Left = 270
TabIndex = 9
Top = 2520
Width = 1050
End
Begin VB.CheckBox Check3
BackColor = &H80000013&
Caption = "户口"
Height = 240
Left = 270
TabIndex = 6
Top = 2040
Value = 1 'Checked
Width = 690
End
Begin VB.CheckBox Check2
BackColor = &H80000013&
Caption = "身高"
Height = 195
Left = 270
TabIndex = 5
Top = 1455
Value = 1 'Checked
Width = 735
End
Begin VB.CheckBox Check1
BackColor = &H80000013&
Caption = "年龄"
Height = 240
Left = 270
TabIndex = 4
Top = 825
Value = 1 'Checked
Width = 690
End
Begin VB.TextBox TxtHeight
Height = 375
Left = 1935
TabIndex = 3
Top = 1350
Width = 1275
End
Begin VB.Label Label7
BackColor = &H80000013&
Caption = "性别"
Height = 195
Left = 540
TabIndex = 27
Top = 315
Width = 465
End
Begin VB.Label Label5
Caption = "到"
Height = 195
Left = 2835
TabIndex = 16
Top = 2520
Width = 195
End
Begin VB.Label Label1
BackColor = &H80000013&
Caption = "岁 到"
Height = 240
Left = 2700
TabIndex = 15
Top = 825
Width = 645
End
Begin VB.Label Label2
BackColor = &H80000013&
Caption = "岁"
Height = 285
Left = 4500
TabIndex = 14
Top = 825
Width = 285
End
Begin VB.Label Label4
BackColor = &H80000013&
Caption = "不低于"
Height = 210
Left = 1350
TabIndex = 8
Top = 1440
Width = 630
End
Begin VB.Label Label3
BackColor = &H80000013&
Caption = "米"
Height = 195
Left = 3375
TabIndex = 7
Top = 1440
Width = 450
End
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 420
Left = 4455
TabIndex = 2
Top = 4905
Width = 1230
End
Begin VB.CommandButton Command1
BackColor = &H00FFFFC0&
Caption = "查询"
Height = 420
Left = 450
TabIndex = 1
Top = 4905
Width = 1185
End
Begin VB.Label Label6
Alignment = 2 'Center
BackColor = &H80000013&
Caption = "信息查询"
BeginProperty Font
Name = "隶书"
Size = 36
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 855
Left = 533
TabIndex = 18
Top = 120
Width = 5055
End
End
Attribute VB_Name = "FrmQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sex As String
Dim tmpStr As String
Private Sub Check1_Click()
If Check1.Value = Checked Then
txtAge1.Enabled = True
txtAge2.Enabled = True
txtAge1.Text = ""
txtAge2.Text = ""
Else
txtAge1.Text = "不限"
txtAge2.Text = "不限"
txtAge1.Enabled = False
txtAge2.Enabled = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = Checked Then
TxtHeight.Enabled = True
TxtHeight.Text = ""
Else
TxtHeight.Text = "不限"
TxtHeight.Enabled = False
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = Checked Then
TxtAera.Enabled = True
TxtAera.Text = ""
Else
TxtAera.Text = "不限"
TxtAera.Enabled = False
End If
End Sub
Private Sub Check4_Click()
If Check4.Value = Checked Then
DTPicker1.Enabled = True
DTPicker2.Enabled = True
Else
DTPicker1.Enabled = False
DTPicker2.Enabled = False
End If
End Sub
Private Sub Check5_Click()
If Check5.Value = Checked Then
Frame3.Enabled = True
Else
Option3.Value = False
Option4.Value = False
Frame3.Enabled = False
End If
End Sub
Private Sub Command1_Click()
On Error Resume Next
Me.MousePointer = 11
If Option1.Value = True Then
Sex = "性别='男'"
ElseIf Option2.Value = True Then
Sex = "性别='女'"
Else
'Sex = "性别='男' or 性别=" & "'女'"
End If
SearchStr = SearchStr & Sex
If Check1.Value = Checked Then
If txtAge1.Text <> "" And txtAge2.Text <> "" Then
SearchStr = SearchStr & "and 年龄>=" & txtAge1.Text & " and 年龄<=" & txtAge2.Text
End If
End If
If Check2.Value = Checked Then
If TxtHeight.Text <> "" Then
SearchStr = SearchStr & "and 身高>=" & TxtHeight.Text
End If
End If
If Check3.Value = Checked Then
If TxtAera.Text <> "" Then
SearchStr = SearchStr & "and 户口 like '%" & TxtAera.Text & "%'"
End If
End If
If Check4.Value = Checked Then
SearchStr = SearchStr & "and 入会时间>= #" & DTPicker1.Value & "# and 入会时间<= #" & DTPicker2.Value & "#"
End If
If Check5.Value = Checked Then
If Option3.Value = True Then
SearchStr = SearchStr & "and 婚姻 like '%未%'"
Else
SearchStr = SearchStr & "and 婚姻 not like '%未%'"
End If
Else
End If
SearchStr = SearchStr & " order by 编号"
' tmpStr = SearchStr
' SearchStr = "select * from mgydb where "
FrmInfo.Show
Me.MousePointer = 0
End Sub
Private Sub Command2_Click()
Dim i As Integer
For i = Forms.Count - 1 To 1 Step -1
Unload Forms(i)
Next
Unload Me
End Sub
Private Sub Command3_Click()
FrmSelectByID.Show
End Sub
Private Sub Form_Load()
SearchStr = "select * from mgydb where "
End Sub
Private Sub Form_Unload(Cancel As Integer)
' SearchStr = tmpStr
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -