frmgzfpcc.frm

来自「企业工资管理系统的具体实现」· FRM 代码 · 共 334 行

FRM
334
字号
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 frmgzfpcc 
   Caption         =   "工作分配查询"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   Icon            =   "frmgzfpcc.frx":0000
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   11010
   ScaleWidth      =   15240
   WindowState     =   2  'Maximized
   Begin VB.Frame Frame2 
      Height          =   5925
      Left            =   30
      TabIndex        =   7
      Top             =   1290
      Width           =   11850
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   360
         Left            =   690
         Top             =   1005
         Visible         =   0   'False
         Width           =   1200
         _ExtentX        =   2117
         _ExtentY        =   635
         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         =   ""
         OLEDBString     =   ""
         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 MSDataGridLib.DataGrid DataGrid1 
         Height          =   5700
         Left            =   75
         TabIndex        =   8
         Top             =   165
         Width           =   11715
         _ExtentX        =   20664
         _ExtentY        =   10054
         _Version        =   393216
         AllowUpdate     =   0   'False
         HeadLines       =   1
         RowHeight       =   15
         FormatLocked    =   -1  'True
         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     =   4
         BeginProperty Column00 
            DataField       =   "cjdh"
            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       =   "cjm"
            Caption         =   "车间名"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "grdh"
            Caption         =   "职工代号"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "xm"
            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 
            ScrollBars      =   3
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
            BeginProperty Column02 
            EndProperty
            BeginProperty Column03 
            EndProperty
         EndProperty
      End
   End
   Begin VB.Frame Frame1 
      Height          =   1350
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   11850
      Begin VB.CheckBox Check3 
         Caption         =   "姓    名:"
         Height          =   270
         Left            =   7725
         TabIndex        =   11
         Top             =   315
         Width           =   1305
      End
      Begin VB.CheckBox Check2 
         Caption         =   "职工代号:"
         Height          =   330
         Left            =   3975
         TabIndex        =   10
         Top             =   285
         Width           =   1200
      End
      Begin VB.CheckBox Check1 
         Caption         =   "车间代号:"
         Height          =   375
         Left            =   780
         TabIndex        =   9
         Top             =   255
         Width           =   1200
      End
      Begin VB.CommandButton Command3 
         Caption         =   "退    出"
         Height          =   405
         Left            =   9990
         TabIndex        =   6
         Top             =   825
         Width           =   960
      End
      Begin VB.CommandButton Command2 
         Caption         =   "全部查询"
         Height          =   405
         Left            =   8985
         TabIndex        =   5
         Top             =   825
         Width           =   960
      End
      Begin VB.CommandButton Command1 
         Caption         =   "选择查询"
         Height          =   405
         Left            =   8010
         TabIndex        =   4
         Top             =   825
         Width           =   960
      End
      Begin VB.TextBox Text2 
         Enabled         =   0   'False
         Height          =   375
         Left            =   9135
         TabIndex        =   3
         Top             =   255
         Width           =   1800
      End
      Begin VB.TextBox Text1 
         Enabled         =   0   'False
         Height          =   375
         Left            =   5340
         TabIndex        =   2
         Top             =   255
         Width           =   2040
      End
      Begin VB.ComboBox Combo1 
         Enabled         =   0   'False
         Height          =   300
         Left            =   2190
         TabIndex        =   1
         Top             =   270
         Width           =   1515
      End
   End
End
Attribute VB_Name = "frmgzfpcc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
If Check1.Value = 1 Then
    Combo1.Enabled = True
Else
    Combo1.Enabled = False
End If
End Sub

Private Sub Check2_Click()
If Check2.Value = 1 Then
    Text1.Enabled = True
Else
    Text1.Text = ""
    Text1.Enabled = False
End If
End Sub

Private Sub Check3_Click()
If Check3.Value = 1 Then
    Text2.Enabled = True
Else
    Text2.Text = ""
    Text2.Enabled = False
End If
End Sub

Private Sub Command1_Click()
Dim sql As String
If Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 0 Then
    MsgBox "请选择需要的查询条件,再进行查询!", vbInformation, "提示"
    Exit Sub
End If
sql = "select * from grfpb where "
If Check1.Value = 1 Then sql = sql & "cjdh='" & Trim(Combo1.Text) & "'"
If Check1.Value = 1 And Check2.Value = 1 Then
    sql = sql & " and grdh='" & Trim(Text1.Text) & "'"
ElseIf Check1.Value = 0 And Check2.Value = 1 Then
    sql = sql & "grdh='" & Trim(Text1.Text) & "'"
End If
If Check1.Value = 1 And Check2.Value = 1 And Check3.Value = 1 Then
    sql = sql & " and xm='" & Trim(Text2.Text) & "'"
ElseIf Check1.Value = 0 And Check2.Value = 1 And Check3.Value = 1 Then
    sql = sql & " and xm='" & Trim(Text2.Text) & "'"
ElseIf Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 1 Then
    sql = sql & " and xm='" & Trim(Text2.Text) & "'"
ElseIf Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 1 Then
    sql = sql & "xm='" & Trim(Text2.Text) & "'"
End If
With Adodc1
    .ConnectionString = constr
    .RecordSource = sql & " order by grdh"
    .Refresh
    If .Recordset.EOF And .Recordset.BOF Then
        MsgBox "没有查到符合条件的记录!", vbInformation, "提示"
        Exit Sub
    End If
End With
End Sub

Private Sub Command2_Click()
With Adodc1
    .ConnectionString = constr
    .RecordSource = "select * from grfpb order by grdh"
    .Refresh
End With
Set DataGrid1.DataSource = Adodc1
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()
Call frmwork(frmgzfpcc)
With Adodc1
    .ConnectionString = constr
    .RecordSource = "select * from grfpb order by grdh"
    .Refresh
End With
Set DataGrid1.DataSource = Adodc1
End Sub

⌨️ 快捷键说明

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