⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form22.frm

📁 小区物业管理系统完整文档及代码。帮助毕业同学做好毕业设计。
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmQts 
   BackColor       =   &H00E0E0E0&
   Caption         =   "住户投诉查询"
   ClientHeight    =   5565
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9210
   LinkTopic       =   "Form22"
   ScaleHeight     =   5565
   ScaleWidth      =   9210
   Begin VB.Frame Frame1 
      BackColor       =   &H00E0E0E0&
      Caption         =   "请输入查询条件"
      ForeColor       =   &H00000000&
      Height          =   3975
      Left            =   360
      TabIndex        =   2
      Top             =   360
      Width           =   8415
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   3840
         TabIndex        =   14
         Top             =   3000
         Width           =   2415
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   3840
         TabIndex        =   13
         Top             =   1800
         Width           =   2415
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   3840
         TabIndex        =   12
         Top             =   720
         Width           =   2415
      End
      Begin VB.ComboBox Combo9 
         Height          =   300
         ItemData        =   "Form22.frx":0000
         Left            =   6840
         List            =   "Form22.frx":000D
         TabIndex        =   11
         Text            =   "Combo9"
         Top             =   3000
         Width           =   975
      End
      Begin VB.ComboBox Combo8 
         Height          =   300
         ItemData        =   "Form22.frx":001F
         Left            =   2280
         List            =   "Form22.frx":002C
         TabIndex        =   10
         Text            =   "Combo8"
         Top             =   3000
         Width           =   975
      End
      Begin VB.ComboBox Combo7 
         Height          =   300
         ItemData        =   "Form22.frx":0039
         Left            =   480
         List            =   "Form22.frx":004C
         TabIndex        =   9
         Text            =   "Combo7"
         Top             =   3000
         Width           =   1215
      End
      Begin VB.ComboBox Combo6 
         Height          =   300
         ItemData        =   "Form22.frx":0082
         Left            =   6840
         List            =   "Form22.frx":008F
         TabIndex        =   8
         Text            =   "Combo6"
         Top             =   1800
         Width           =   975
      End
      Begin VB.ComboBox Combo5 
         Height          =   300
         ItemData        =   "Form22.frx":00A1
         Left            =   2280
         List            =   "Form22.frx":00AE
         TabIndex        =   7
         Text            =   "Combo5"
         Top             =   1800
         Width           =   975
      End
      Begin VB.ComboBox Combo4 
         Height          =   300
         ItemData        =   "Form22.frx":00BB
         Left            =   480
         List            =   "Form22.frx":00CE
         TabIndex        =   6
         Text            =   "Combo4"
         Top             =   1800
         Width           =   1215
      End
      Begin VB.ComboBox Combo3 
         Height          =   300
         ItemData        =   "Form22.frx":0104
         Left            =   6840
         List            =   "Form22.frx":0111
         TabIndex        =   5
         Text            =   "Combo3"
         Top             =   720
         Width           =   975
      End
      Begin VB.ComboBox Combo2 
         Height          =   300
         ItemData        =   "Form22.frx":0123
         Left            =   2280
         List            =   "Form22.frx":0130
         TabIndex        =   4
         Text            =   "Combo2"
         Top             =   720
         Width           =   975
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         ItemData        =   "Form22.frx":013D
         Left            =   480
         List            =   "Form22.frx":0150
         TabIndex        =   3
         Text            =   "Combo1"
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label Label12 
         BackColor       =   &H00E0E0E0&
         Caption         =   "逻辑关系"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   6960
         TabIndex        =   26
         Top             =   2640
         Width           =   975
      End
      Begin VB.Label Label11 
         BackColor       =   &H00E0E0E0&
         Caption         =   "查找内容"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   4680
         TabIndex        =   25
         Top             =   2640
         Width           =   735
      End
      Begin VB.Label Label10 
         BackColor       =   &H00E0E0E0&
         Caption         =   "关系"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   2520
         TabIndex        =   24
         Top             =   2640
         Width           =   615
      End
      Begin VB.Label Label9 
         BackColor       =   &H00E0E0E0&
         Caption         =   "字段名"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   840
         TabIndex        =   23
         Top             =   2640
         Width           =   615
      End
      Begin VB.Label Label8 
         BackColor       =   &H00E0E0E0&
         Caption         =   "逻辑关系"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   6960
         TabIndex        =   22
         Top             =   1440
         Width           =   1095
      End
      Begin VB.Label Label7 
         BackColor       =   &H00E0E0E0&
         Caption         =   "查找内容"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   4680
         TabIndex        =   21
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label Label6 
         BackColor       =   &H00E0E0E0&
         Caption         =   "关系"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   2520
         TabIndex        =   20
         Top             =   1440
         Width           =   375
      End
      Begin VB.Label Label5 
         BackColor       =   &H00E0E0E0&
         Caption         =   "字段名"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   840
         TabIndex        =   19
         Top             =   1440
         Width           =   615
      End
      Begin VB.Label Label4 
         BackColor       =   &H00E0E0E0&
         Caption         =   "逻辑关系"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   6960
         TabIndex        =   18
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label3 
         BackColor       =   &H00E0E0E0&
         Caption         =   "查找内容"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   4680
         TabIndex        =   17
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label2 
         BackColor       =   &H00E0E0E0&
         Caption         =   "关系"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   2520
         TabIndex        =   16
         Top             =   360
         Width           =   375
      End
      Begin VB.Label Label1 
         BackColor       =   &H00E0E0E0&
         Caption         =   "字段名"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   840
         TabIndex        =   15
         Top             =   360
         Width           =   615
      End
   End
   Begin VB.CommandButton cmdClose 
      Caption         =   "关    闭"
      Height          =   495
      Left            =   5280
      TabIndex        =   1
      Top             =   4680
      Width           =   1335
   End
   Begin VB.CommandButton cmdQuery 
      BackColor       =   &H00E0E0E0&
      Caption         =   "查    询"
      Height          =   495
      Left            =   2400
      TabIndex        =   0
      Top             =   4680
      Width           =   1335
   End
End
Attribute VB_Name = "frmQts"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClose_Click()
   Unload Me
End Sub

Private Sub cmdQuery_Click()
'要求至少要有一个查询条件,而且查询条件要靠前写,即如果只有一个查询条件
'必须输在第一行,有2个查询条件,只能输在1,2两行上
   If Text1.Text = "" Then
       MsgBox "请输入至少一个查询条件,或把查询条件输入在前面的行上!", vbOKOnly + vbInformation, "注意"
       Text1.SetFocus
       Text2.Text = ""
       Text3.Text = ""
       Exit Sub
   End If
   If Text2.Text = "" And Not Text3.Text = "" Then
       MsgBox "请把查询条件输入在前面的行上!", vbOKOnly + vbInformation, "注意"
       Text2.SetFocus
       Text3.Text = ""
       Exit Sub
   End If
   '除使日期以外的查询字段其查询关系不能为> 或 <,判断之
   If Not Text1.Text = "" And Not Combo1.ListIndex = 2 And Not Combo1.ListIndex = 4 And Not Combo2.ListIndex = 0 Then
      MsgBox "该字段的查找关系不能为 > 或 < !", vbOKOnly + vbInformation, "注意"
      Combo2.SetFocus
      Exit Sub
   End If
   If Not Text2.Text = "" And Not Combo4.ListIndex = 2 And Not Combo4.ListIndex = 4 And Not Combo5.ListIndex = 0 Then
      MsgBox "该字段的查找关系不能为 > 或 < !", vbOKOnly + vbInformation, "注意"
      Combo5.SetFocus
      Exit Sub
   End If
   If Not Text3.Text = "" And Not Combo7.ListIndex = 2 And Not Combo7.ListIndex = 4 And Not Combo8.ListIndex = 0 Then
      MsgBox "该字段的查找关系不能为 > 或 < !", vbOKOnly + vbInformation, "注意"
      Combo8.SetFocus
      Exit Sub
   End If
   '设置查询判断变量为真
   queryTs = True
   '使用全局变量sqlTs保存该查询表达式的sql 语句
   '如果查询字段是日期,则需要转换text1.text的内容
   If Combo1.ListIndex = 2 Or Combo1.ListIndex = 4 Then
       '先要判断输入的是否为日期型
       If IsDate(Text1.Text) = False Then
          MsgBox "输入的不是日期型内容,请输入这样的日期格式:2003-8-3!", vbOKOnly + vbInformation, "注意"
          Exit Sub
       End If
       'DateValue 函数把字符串转换为日期
       sqlTs = "where " & Combo1.Text & Combo2.Text & "#" & DateValue(Text1.Text) & "#"
   Else
       sqlTs = "where " & Combo1.Text & Combo2.Text & "'" & Text1.Text & "'"
   End If
   If Not Text2.Text = "" Then
      If Combo4.ListIndex = 2 Or Combo4.ListIndex = 4 Then
          '先要判断输入的是否为日期型
          If IsDate(Text2.Text) = False Then
             MsgBox "输入的不是日期型内容,请输入这样的日期格式:2003-8-3!", vbOKOnly + vbInformation, "注意"
             Exit Sub
          End If
          'combo3.text是and or not 等逻辑字符,其前后需要各加上一个空格
          sqlTs = sqlTs & " " & Combo3.Text & " " & Combo4.Text & Combo5.Text & "#" & DateValue(Text2.Text) & "#"
      Else
          sqlTs = sqlTs & " " & Combo3.Text & " " & Combo4.Text & Combo5.Text & "'" & Text2.Text & "'"
      End If
   End If
   If Not Text3.Text = "" Then
      If Combo7.ListIndex = 2 Or Combo7.ListIndex = 4 Then
          '先要判断输入的是否为日期型
          If IsDate(Text3.Text) = False Then
             MsgBox "输入的不是日期型内容,请输入这样的日期格式:2003-8-3!", vbOKOnly + vbInformation, "注意"
             Exit Sub
          End If
          sqlTs = sqlTs & " " & Combo6.Text & " " & Combo7.Text & Combo8.Text & "#" & DateValue(Text3.Text) & "#"
      Else
          sqlTs = sqlTs & " " & Combo6.Text & " " & Combo7.Text & Combo8.Text & "'" & Text3.Text & "'"
      End If
   End If
   frmC5.Show
   Unload Me
End Sub

Private Sub Form_Load()
   frmQts.Width = 9330
   frmQts.Height = 5970
   '让窗体居中
   Dim x0 As Long
   Dim y0 As Long
   x0 = Screen.Width
   y0 = Screen.Height
   x0 = (x0 - Me.Width) / 2
   y0 = (y0 - Me.Height) / 2
   Me.Move x0, y0
   Combo1.ListIndex = 0
   Combo2.ListIndex = 0
   Combo3.ListIndex = 0
   Combo4.ListIndex = 0
   Combo5.ListIndex = 0
   Combo6.ListIndex = 0
   Combo7.ListIndex = 0
   Combo8.ListIndex = 0
   Combo9.ListIndex = 0
   Text1.Text = ""
   Text2.Text = ""
   Text3.Text = ""
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -