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

📄 select.frm

📁 职工信息系统
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmSelect 
   Caption         =   "筛选数据"
   ClientHeight    =   2640
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5355
   Icon            =   "select.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2640
   ScaleWidth      =   5355
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame2 
      Caption         =   "筛选条件"
      Height          =   1455
      Left            =   120
      TabIndex        =   9
      Top             =   1080
      Width           =   5175
      Begin VB.OptionButton lblLike 
         Caption         =   "like"
         Height          =   255
         Left            =   2760
         TabIndex        =   17
         Top             =   360
         Width           =   750
      End
      Begin VB.OptionButton lblEqual 
         Caption         =   "="
         Height          =   255
         Left            =   1320
         TabIndex        =   16
         Top             =   360
         Value           =   -1  'True
         Width           =   495
      End
      Begin VB.OptionButton lblSmall 
         Caption         =   "<"
         Height          =   255
         Left            =   1800
         TabIndex        =   13
         Top             =   360
         Width           =   495
      End
      Begin VB.TextBox txtCompare 
         Height          =   270
         Left            =   3600
         TabIndex        =   12
         Top             =   360
         Width           =   1455
      End
      Begin VB.OptionButton lblLarge 
         Caption         =   ">"
         Height          =   255
         Left            =   2280
         TabIndex        =   11
         Top             =   360
         Width           =   495
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         ItemData        =   "select.frx":0442
         Left            =   120
         List            =   "select.frx":045E
         TabIndex        =   10
         Text            =   "职称"
         Top             =   360
         Width           =   1095
      End
      Begin MSComctlLib.ImageList ImageList1 
         Left            =   3840
         Top             =   720
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   -2147483643
         ImageWidth      =   32
         ImageHeight     =   32
         MaskColor       =   12632256
         _Version        =   393216
         BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
            NumListImages   =   1
            BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "select.frx":049E
               Key             =   ""
            EndProperty
         EndProperty
      End
      Begin MSComctlLib.Toolbar Toolbar1 
         Height          =   570
         Index           =   0
         Left            =   1920
         TabIndex        =   15
         Top             =   720
         Width           =   1695
         _ExtentX        =   2990
         _ExtentY        =   1005
         ButtonWidth     =   2408
         ButtonHeight    =   1005
         Style           =   1
         TextAlignment   =   1
         ImageList       =   "ImageList1"
         _Version        =   393216
         BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
            NumButtons      =   1
            BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
               Caption         =   "开始筛选"
               Object.ToolTipText     =   "输入符合您设置条件特征的职工信息列表"
               ImageIndex      =   1
            EndProperty
         EndProperty
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "选择要显示的字段"
      Height          =   975
      Left            =   100
      TabIndex        =   0
      Top             =   50
      Width           =   5175
      Begin VB.CheckBox Check1 
         Caption         =   "全选"
         Height          =   615
         Left            =   120
         Style           =   1  'Graphical
         TabIndex        =   14
         Top             =   240
         Width           =   735
      End
      Begin VB.CheckBox hf 
         Caption         =   "婚否"
         Height          =   255
         Left            =   4200
         TabIndex        =   8
         Top             =   600
         Value           =   1  'Checked
         Width           =   735
      End
      Begin VB.CheckBox gz 
         Caption         =   "工资"
         Height          =   255
         Left            =   4200
         TabIndex        =   7
         Top             =   240
         Width           =   735
      End
      Begin VB.CheckBox xl 
         Caption         =   "学历"
         Height          =   255
         Left            =   3240
         TabIndex        =   6
         Top             =   600
         Width           =   975
      End
      Begin VB.CheckBox zc 
         Caption         =   "职称"
         Height          =   255
         Left            =   2280
         TabIndex        =   5
         Top             =   600
         Value           =   1  'Checked
         Width           =   735
      End
      Begin VB.CheckBox csly 
         Caption         =   "出生年月"
         Height          =   255
         Left            =   960
         TabIndex        =   4
         Top             =   600
         Value           =   1  'Checked
         Width           =   1215
      End
      Begin VB.CheckBox xb 
         Caption         =   "性别"
         Height          =   255
         Left            =   3240
         TabIndex        =   3
         Top             =   240
         Width           =   975
      End
      Begin VB.CheckBox xm 
         Caption         =   "姓名"
         Height          =   255
         Left            =   2280
         TabIndex        =   2
         Top             =   240
         Value           =   1  'Checked
         Width           =   855
      End
      Begin VB.CheckBox zgbh 
         Caption         =   "职工编号"
         Height          =   255
         Left            =   960
         TabIndex        =   1
         Top             =   240
         Width           =   1215
      End
   End
End
Attribute VB_Name = "frmSelect"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
zgbh.Value = Check1.Value
xm.Value = Check1.Value
xb.Value = Check1.Value
csly.Value = Check1.Value
zc.Value = Check1.Value
gz.Value = Check1.Value
hf.Value = Check1.Value
xl.Value = Check1.Value
End Sub
Private Sub Form_Load()
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2, Me.Width, Me.Height
AniShowFrm Me.hwnd
End Sub
Private Sub Form_Unload(Cancel As Integer)
AniUnloadFrm Me.hwnd
End Sub

Private Sub Toolbar1_ButtonClick(Index As Integer, ByVal Button As MSComctlLib.Button)
On Error GoTo Err:
Dim StrSql As String

StrSql = "select "
    If zgbh.Value = 1 Then StrSql = StrSql + "职工编号,"
    If xm.Value = 1 Then StrSql = StrSql + "姓名,"
    If xb.Value = 1 Then StrSql = StrSql + "性别,"
    If gz.Value = 1 Then StrSql = StrSql + "工资,"
    If csly.Value = 1 Then StrSql = StrSql + "出生年月,"
    If zc.Value = 1 Then StrSql = StrSql + "职称,"
    If xl.Value = 1 Then StrSql = StrSql + "最后学历,"
    If hf.Value = 1 Then StrSql = StrSql + "婚否,"
StrSql = Left(StrSql, Len(StrSql) - 1)
StrSql = StrSql + " from 职工信息 where " + Combo1
If Combo1 = "工资" Then
   If lblEqual.Value Then StrSql = StrSql + " = " + txtCompare
   If lblLarge.Value Then StrSql = StrSql + " > " + txtCompare
   If lblSmall.Value Then StrSql = StrSql + " < " + txtCompare
   If lblLike.Value Then StrSql = StrSql + " like *" + txtCompare
Else
   If lblEqual.Value Then StrSql = StrSql + " = '" + txtCompare + "'"
   If lblLarge.Value Then StrSql = StrSql + " > '" + txtCompare + "'"
   If lblSmall.Value Then StrSql = StrSql + " < '" + txtCompare + "'"
   If lblLike.Value Then StrSql = StrSql + " like *'" + txtCompare + "*'"
End If
StrSql = StrSql + " order by " + Combo1
MsgBox StrSql, , "SQL查询语句:"
'frmDocument.Data1.RecordSource = "select 姓名,工资,性别 from 职工信息 where 工资 > 1000"
frmDocument.Data1.RecordSource = StrSql
frmDocument.Data1.Refresh
Exit Sub
Err: MsgBox "查找出错!请您检查选择的查询条件是否正确" & vbCrLf & "错误内容:" & Err.Description, vbCritical, "提示:"
End Sub

⌨️ 快捷键说明

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