上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:28k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  4. Begin VB.Form Qr_RsArFrm 
  5.    Caption         =   "档案查询结果"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11820
  10.    HelpContextID   =   2114002
  11.    Icon            =   "查询_人事档案列表.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11820
  17.    WindowState     =   2  'Maximized
  18.    Begin MSComctlLib.ProgressBar PB_Proc 
  19.       Height          =   330
  20.       Left            =   3795
  21.       TabIndex        =   5
  22.       Top             =   3735
  23.       Visible         =   0   'False
  24.       Width           =   4440
  25.       _ExtentX        =   7832
  26.       _ExtentY        =   582
  27.       _Version        =   393216
  28.       Appearance      =   1
  29.       Scrolling       =   1
  30.    End
  31.    Begin VB.PictureBox Pic_Title 
  32.       BackColor       =   &H00FFFFFF&
  33.       Height          =   825
  34.       Left            =   -75
  35.       Picture         =   "查询_人事档案列表.frx":1042
  36.       ScaleHeight     =   765
  37.       ScaleWidth      =   11715
  38.       TabIndex        =   3
  39.       Top             =   600
  40.       Width           =   11775
  41.       Begin VB.Label Lab_Title 
  42.          AutoSize        =   -1  'True
  43.          BackColor       =   &H80000018&
  44.          BackStyle       =   0  'Transparent
  45.          Caption         =   "档案查询结果"
  46.          BeginProperty Font 
  47.             Name            =   "宋体"
  48.             Size            =   12
  49.             Charset         =   134
  50.             Weight          =   700
  51.             Underline       =   0   'False
  52.             Italic          =   0   'False
  53.             Strikethrough   =   0   'False
  54.          EndProperty
  55.          ForeColor       =   &H00000000&
  56.          Height          =   240
  57.          Left            =   405
  58.          TabIndex        =   4
  59.          Top             =   225
  60.          Width           =   1530
  61.       End
  62.    End
  63.    Begin MSComctlLib.Toolbar GsToolbar 
  64.       Height          =   540
  65.       Left            =   9225
  66.       TabIndex        =   1
  67.       Top             =   30
  68.       Width           =   2580
  69.       _ExtentX        =   4551
  70.       _ExtentY        =   953
  71.       ButtonWidth     =   1455
  72.       ButtonHeight    =   953
  73.       AllowCustomize  =   0   'False
  74.       Appearance      =   1
  75.       Style           =   1
  76.       ImageList       =   "ImageList1"
  77.       _Version        =   393216
  78.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  79.          NumButtons      =   3
  80.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  81.             Caption         =   "保存格式"
  82.             Key             =   "bcgs"
  83.             ImageKey        =   "bcgs"
  84.          EndProperty
  85.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  86.             Caption         =   "默认列宽"
  87.             Key             =   "hfmrgs"
  88.             ImageKey        =   "mrlk"
  89.          EndProperty
  90.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  91.             Caption         =   "显示项目"
  92.             Key             =   "szxsxm"
  93.             ImageKey        =   "xsxm"
  94.          EndProperty
  95.       EndProperty
  96.    End
  97.    Begin VB.Timer Timer1 
  98.       Enabled         =   0   'False
  99.       Interval        =   1
  100.       Left            =   7620
  101.       Top             =   90
  102.    End
  103.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  104.       Height          =   7545
  105.       Left            =   60
  106.       TabIndex        =   0
  107.       Top             =   1530
  108.       Width           =   11775
  109.       _ExtentX        =   20770
  110.       _ExtentY        =   13309
  111.       Appearance      =   1
  112.       BorderStyle     =   1
  113.       Enabled         =   -1  'True
  114.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  115.          Name            =   "宋体"
  116.          Size            =   9
  117.          Charset         =   134
  118.          Weight          =   400
  119.          Underline       =   0   'False
  120.          Italic          =   0   'False
  121.          Strikethrough   =   0   'False
  122.       EndProperty
  123.       MousePointer    =   0
  124.       BackColor       =   16777215
  125.       ForeColor       =   -2147483640
  126.       BackColorFixed  =   13826538
  127.       ForeColorFixed  =   -2147483630
  128.       BackColorSel    =   -2147483635
  129.       ForeColorSel    =   -2147483634
  130.       BackColorBkg    =   -2147483636
  131.       BackColorAlternate=   16777215
  132.       GridColor       =   -2147483633
  133.       GridColorFixed  =   -2147483632
  134.       TreeColor       =   -2147483632
  135.       FloodColor      =   192
  136.       SheetBorder     =   -2147483642
  137.       FocusRect       =   1
  138.       HighLight       =   1
  139.       AllowSelection  =   -1  'True
  140.       AllowBigSelection=   -1  'True
  141.       AllowUserResizing=   0
  142.       SelectionMode   =   0
  143.       GridLines       =   1
  144.       GridLinesFixed  =   2
  145.       GridLineWidth   =   1
  146.       Rows            =   1
  147.       Cols            =   0
  148.       FixedRows       =   1
  149.       FixedCols       =   0
  150.       RowHeightMin    =   0
  151.       RowHeightMax    =   0
  152.       ColWidthMin     =   0
  153.       ColWidthMax     =   0
  154.       ExtendLastCol   =   0   'False
  155.       FormatString    =   ""
  156.       ScrollTrack     =   0   'False
  157.       ScrollBars      =   3
  158.       ScrollTips      =   0   'False
  159.       MergeCells      =   0
  160.       MergeCompare    =   0
  161.       AutoResize      =   -1  'True
  162.       AutoSizeMode    =   0
  163.       AutoSearch      =   0
  164.       MultiTotals     =   -1  'True
  165.       SubtotalPosition=   1
  166.       OutlineBar      =   0
  167.       OutlineCol      =   0
  168.       Ellipsis        =   0
  169.       ExplorerBar     =   0
  170.       PicturesOver    =   0   'False
  171.       FillStyle       =   0
  172.       RightToLeft     =   0   'False
  173.       PictureType     =   0
  174.       TabBehavior     =   0
  175.       OwnerDraw       =   0
  176.       Editable        =   0   'False
  177.       ShowComboButton =   -1  'True
  178.       WordWrap        =   0   'False
  179.       TextStyle       =   0
  180.       TextStyleFixed  =   0
  181.       OleDragMode     =   0
  182.       OleDropMode     =   0
  183.       DataMode        =   0
  184.       VirtualData     =   -1  'True
  185.    End
  186.    Begin MSComctlLib.Toolbar SzToolbar 
  187.       Align           =   1  'Align Top
  188.       Height          =   570
  189.       Left            =   0
  190.       TabIndex        =   2
  191.       Top             =   0
  192.       Width           =   11820
  193.       _ExtentX        =   20849
  194.       _ExtentY        =   1005
  195.       ButtonWidth     =   820
  196.       ButtonHeight    =   953
  197.       AllowCustomize  =   0   'False
  198.       Appearance      =   1
  199.       Style           =   1
  200.       ImageList       =   "ImageList1"
  201.       _Version        =   393216
  202.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  203.          NumButtons      =   12
  204.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  205.             Caption         =   "设置"
  206.             Key             =   "ymsz"
  207.             Object.ToolTipText     =   "设置打印参数"
  208.             ImageKey        =   "sz"
  209.          EndProperty
  210.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  211.             Caption         =   "打印"
  212.             Key             =   "dy"
  213.             Object.ToolTipText     =   "打印当前数据"
  214.             ImageKey        =   "dy"
  215.          EndProperty
  216.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  217.             Caption         =   "预览"
  218.             Key             =   "yl"
  219.             Object.ToolTipText     =   "显示当前数据的打印模式"
  220.             ImageKey        =   "yl"
  221.          EndProperty
  222.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  223.             Style           =   3
  224.          EndProperty
  225.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  226.             Caption         =   "查询"
  227.             Key             =   "cx"
  228.             Object.ToolTipText     =   "以某种条件取得数据"
  229.             ImageKey        =   "cx"
  230.          EndProperty
  231.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  232.             Caption         =   "编辑"
  233.             Key             =   "edit"
  234.             ImageIndex      =   4
  235.          EndProperty
  236.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  237.             Object.Visible         =   0   'False
  238.             Caption         =   "删除"
  239.             Key             =   "del"
  240.             ImageIndex      =   22
  241.          EndProperty
  242.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  243.             Style           =   3
  244.          EndProperty
  245.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  246.             Caption         =   "刷新"
  247.             Key             =   "Refresh"
  248.             Object.ToolTipText     =   "重新显示当前人员列表"
  249.             ImageKey        =   "sx"
  250.          EndProperty
  251.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  252.             Style           =   3
  253.          EndProperty
  254.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  255.             Caption         =   "帮助"
  256.             Key             =   "bz"
  257.             Object.ToolTipText     =   "显示帮助信息"
  258.             ImageKey        =   "bz"
  259.          EndProperty
  260.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  261.             Caption         =   "退出"
  262.             Key             =   "fh"
  263.             Object.ToolTipText     =   "退出本报表"
  264.             ImageKey        =   "tc"
  265.          EndProperty
  266.       EndProperty
  267.       BorderStyle     =   1
  268.       Begin MSComctlLib.ImageList ImageList1 
  269.          Left            =   5280
  270.          Top             =   0
  271.          _ExtentX        =   1005
  272.          _ExtentY        =   1005
  273.          BackColor       =   -2147483643
  274.          ImageWidth      =   16
  275.          ImageHeight     =   16
  276.          MaskColor       =   12632256
  277.          _Version        =   393216
  278.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  279.             NumListImages   =   36
  280.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  281.                Picture         =   "查询_人事档案列表.frx":1DF82
  282.                Key             =   "sz"
  283.             EndProperty
  284.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  285.                Picture         =   "查询_人事档案列表.frx":1E31C
  286.                Key             =   "dy"
  287.             EndProperty
  288.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  289.                Picture         =   "查询_人事档案列表.frx":1E6B6
  290.                Key             =   "yl"
  291.             EndProperty
  292.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  293.                Picture         =   "查询_人事档案列表.frx":1EA50
  294.                Key             =   "xg"
  295.             EndProperty
  296.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  297.                Picture         =   "查询_人事档案列表.frx":1EDEA
  298.                Key             =   "zh"
  299.             EndProperty
  300.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  301.                Picture         =   "查询_人事档案列表.frx":1F184
  302.                Key             =   "sh"
  303.             EndProperty
  304.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  305.                Picture         =   "查询_人事档案列表.frx":1F51E
  306.                Key             =   "bc"
  307.             EndProperty
  308.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.                Picture         =   "查询_人事档案列表.frx":1F8B8
  310.                Key             =   "fq"
  311.             EndProperty
  312.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.                Picture         =   "查询_人事档案列表.frx":1FC52
  314.                Key             =   "bz"
  315.             EndProperty
  316.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.                Picture         =   "查询_人事档案列表.frx":1FFEC
  318.                Key             =   "tc"
  319.             EndProperty
  320.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.                Picture         =   "查询_人事档案列表.frx":20386
  322.                Key             =   "bcgs"
  323.             EndProperty
  324.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  325.                Picture         =   "查询_人事档案列表.frx":20720
  326.                Key             =   "mrlk"
  327.             EndProperty
  328.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  329.                Picture         =   "查询_人事档案列表.frx":20ABA
  330.                Key             =   "xsxm"
  331.             EndProperty
  332.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  333.                Picture         =   "查询_人事档案列表.frx":20E54
  334.                Key             =   "first"
  335.             EndProperty
  336.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  337.                Picture         =   "查询_人事档案列表.frx":211EE
  338.                Key             =   "prev"
  339.             EndProperty
  340.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  341.                Picture         =   "查询_人事档案列表.frx":21588
  342.                Key             =   "next"
  343.             EndProperty
  344.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  345.                Picture         =   "查询_人事档案列表.frx":21922
  346.                Key             =   "last"
  347.             EndProperty
  348.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  349.                Picture         =   "查询_人事档案列表.frx":21CBC
  350.                Key             =   "xx"
  351.             EndProperty
  352.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  353.                Picture         =   "查询_人事档案列表.frx":22056
  354.                Key             =   "define"
  355.             EndProperty
  356.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  357.                Picture         =   "查询_人事档案列表.frx":223F0
  358.                Key             =   "exec"
  359.             EndProperty
  360.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  361.                Picture         =   "查询_人事档案列表.frx":2278A
  362.                Key             =   "xz"
  363.             EndProperty
  364.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  365.                Picture         =   "查询_人事档案列表.frx":22B24
  366.                Key             =   "sc"
  367.             EndProperty
  368.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  369.                Picture         =   "查询_人事档案列表.frx":22EBE
  370.                Key             =   "sx"
  371.             EndProperty
  372.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  373.                Picture         =   "查询_人事档案列表.frx":23258
  374.                Key             =   "cx"
  375.             EndProperty
  376.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  377.                Picture         =   "查询_人事档案列表.frx":235F2
  378.                Key             =   "zd"
  379.             EndProperty
  380.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  381.                Picture         =   "查询_人事档案列表.frx":2398C
  382.                Key             =   "dz"
  383.             EndProperty
  384.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  385.                Picture         =   "查询_人事档案列表.frx":23D26
  386.                Key             =   "ph"
  387.             EndProperty
  388.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  389.                Picture         =   "查询_人事档案列表.frx":240C0
  390.                Key             =   "fz"
  391.             EndProperty
  392.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  393.                Picture         =   "查询_人事档案列表.frx":2445A
  394.                Key             =   "Locate"
  395.             EndProperty
  396.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  397.                Picture         =   "查询_人事档案列表.frx":247F4
  398.                Key             =   "hf"
  399.             EndProperty
  400.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  401.                Picture         =   "查询_人事档案列表.frx":24B8E
  402.                Key             =   "pz"
  403.             EndProperty
  404.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  405.                Picture         =   "查询_人事档案列表.frx":24F28
  406.                Key             =   "check"
  407.             EndProperty
  408.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  409.                Picture         =   "查询_人事档案列表.frx":252C2
  410.                Key             =   "Sum"
  411.             EndProperty
  412.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  413.                Picture         =   "查询_人事档案列表.frx":2565C
  414.                Key             =   "Total"
  415.             EndProperty
  416.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  417.                Picture         =   "查询_人事档案列表.frx":259F6
  418.                Key             =   "Detail"
  419.             EndProperty
  420.             BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  421.                Picture         =   "查询_人事档案列表.frx":25D90
  422.                Key             =   "Order"
  423.             EndProperty
  424.          EndProperty
  425.       End
  426.    End
  427. End
  428. Attribute VB_Name = "Qr_RsArFrm"
  429. Attribute VB_GlobalNameSpace = False
  430. Attribute VB_Creatable = False
  431. Attribute VB_PredeclaredId = True
  432. Attribute VB_Exposed = False
  433. '**************************************************************************
  434. '*    模 块 名 称 :人事信息查询
  435. '*    功 能 描 述 :
  436. '*    程序员姓名  :苗鹏
  437. '*    最后修改人  :苗鹏
  438. '*    最后修改时间:2002/01/02
  439. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  440. '**************************************************************************
  441. Dim ReportTitle As String                '报表主标题
  442. Public sSqlWhere As String
  443. Dim sSqlFrom As String
  444. Public sArSort As String
  445. Public sArSortName As String
  446. Dim sSqlOrder As String
  447. Dim sCode() As New CCode
  448. '以下为固定使用变量
  449. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  450. Dim GridCode As String                   '显示网格网格代码
  451. Dim GridInf() As Variant                 '整个网格设置信息
  452. Dim Tsxx As String                       '系统提示信息
  453. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  454. Dim Sjhgd As Double                      '网格数据行高度
  455. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  456. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  457. Dim GridStr()  As String                 '网格列信息(字符型)
  458. Dim GridInt() As Integer                 '网格列信息(整型)
  459. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  460. Private Sub CxbbGrid_AfterSort(ByVal Col As Long, Order As Integer)
  461.     Dim i As Long
  462.     With Me.CxbbGrid
  463.         For i = .FixedRows To .Rows - 1
  464.             .TextMatrix(i, Qslz) = i - .FixedRows + 1
  465.         Next i
  466.     End With
  467.     
  468. End Sub
  469. Private Sub CxbbGrid_DblClick()
  470.     With Me.CxbbGrid
  471.         If .Rows = .FixedRows Then
  472.             Exit Sub
  473.         End If
  474.         '调用人事修改窗体
  475.         Ed_EmpCorArFrm.int_if = 0
  476.         Ed_EmpCorArFrm.Lbl_ArName.Tag = sArSort
  477.         Ed_EmpCorArFrm.EmpId = .TextMatrix(.Row, 1)
  478.         Ed_EmpCorArFrm.Lbl_ArName.Caption = "档案类别:  " & Me.sArSortName
  479.         Ed_EmpCorArFrm.Lbl_EmpNo.Caption = "职工号:" & .TextMatrix(.Row, Sydz("001", GridStr(), Szzls))
  480.         Ed_EmpCorArFrm.Lbl_EmpName.Caption = "姓名:" & .TextMatrix(.Row, Sydz("002", GridStr(), Szzls))
  481.         Ed_EmpCorArFrm.Ini_Grid
  482.         Ed_EmpCorArFrm.Show 1
  483.         ShowRecord sSqlWhere
  484.     End With
  485. End Sub
  486. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  487.     On Error Resume Next
  488.     With CxbbGrid
  489.         .Width = Me.Width - 160
  490.         .Height = Me.Height - .Top - 400
  491.     End With
  492.     With Pic_Title
  493.         .Width = Me.Width - 160
  494.     End With
  495.     
  496.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  497.     With Me.PB_Proc
  498.         .Left = (Me.Width - .Width) / 2
  499.         .Top = Me.Height / 2
  500.     End With
  501.     
  502. End Sub
  503. Private Sub Form_Load()                                                   '窗体装入
  504.     
  505.     '调入打印页面设置窗体
  506.     ReportTitle = sArSortName + "档案信息"
  507.     XtReportCode = "Rs_ArFrm"
  508.     Load Dyymctbl
  509.     Me.Caption = ReportTitle
  510.     Me.Lab_Title = ReportTitle
  511.     '调整标题栏及网格、格式工具条位置(Fixed)
  512.     Pic_Title.Left = 40
  513.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  514.     CxbbGrid.Left = Pic_Title.Left
  515.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  516.     
  517.     '调 入 网 格(Fixed)
  518.     If GridCode = "" Then
  519.         GridCode = "Rs_ArFrm"
  520.     End If
  521.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  522.     Qslz = GridInf(1)
  523.     Sjhgd = GridInf(2)
  524.     Sfxshjwg = GridInf(7)
  525.     Szzls = CxbbGrid.Cols - 1
  526.     iBeginCol = Val(GridInf(1))
  527.     '初始化变量
  528.     sSqlOrder = " order by Rs_BasicInfo.EmpNo " & Chr(10)
  529.     sSqlFrom = "From Rs_ArMain inner join Rs_BasicInfo on Rs_BasicInfo.EmpID=Rs_ArMain.EmpID" & Chr(10)
  530. End Sub
  531. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  532.         
  533.     '卸载打印页面设置窗体
  534.     Unload Dyymctbl
  535.     Security_Log "Rs_Qr_RsAr", Xtczybm, 2, False  '用户退出时写上机日志
  536. End Sub
  537. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  538.     
  539.     Select Case Button.Key
  540.     Case "bcgs"                                          '保存表格格式
  541.         Call Bcwggs(CxbbGrid, GridCode, GridStr())
  542.     Case "hfmrgs"                                        '恢复默认格式
  543.         Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  544.     Case "szxsxm"                                        '设置显示项目
  545.         Call Szxsxm(CxbbGrid, GridCode)
  546.     End Select
  547.     
  548. End Sub
  549. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  550.     
  551.     Select Case Button.Key
  552.     Case "ymsz"                                          '页面设置
  553.         Dyymctbl.Show 1
  554.     Case "yl"                                            '预 览
  555.         If NoRec Then Exit Sub
  556.         bbyl (True)
  557.     Case "dy"                                            '打 印
  558.         If NoRec Then Exit Sub
  559.         bbyl (False)
  560.     Case "cx"                                            '查 询
  561.         Qr_RsArCndFrm.Show 1
  562.     Case "edit"                                          '编辑
  563.           CxbbGrid_DblClick
  564.     Case "Refresh"                                       '刷新
  565.         ShowRecord sSqlWhere
  566.     Case "bz"                                            '帮 助
  567.         Call F1bz
  568.     Case "fh"                                            '退 出
  569.         Unload Me
  570.     End Select
  571.     
  572.     
  573. End Sub
  574. Private Function NoRec() As Boolean
  575. '判断网格是否有记录
  576. Dim i As Integer
  577. NoRec = True
  578. With Me.CxbbGrid
  579. If .Rows = .FixedRows Then
  580.     Exit Function
  581. End If
  582. For i = 0 To .Rows - 1
  583.     If .RowHidden(i) = False Then
  584.         NoRec = False
  585.         Exit For
  586.     End If
  587. Next i
  588. End With
  589. End Function
  590. Private Function DelRecords() As Boolean
  591. '删除选中的记录,支持一次多条
  592. Dim i As Integer
  593. Dim sSql As String
  594. DelRecords = False
  595. If Xtxxts("请确认是否删除当前记录?", 2, 2) = vbCancel Then Exit Function
  596. With CxbbGrid
  597.     For i = 1 To .Rows - 1
  598.         If .IsSelected(i) Then sSql = sSql & " DELETE FROM Rs_ArMain WHERE ArSort = '" & Me.sArSort & "' AND Sno = '" & .TextMatrix(i, 2) & "' AND EmpId = '" & .TextMatrix(i, 1) & "'"
  599.     Next i
  600.     If .Row > .RowSel Then
  601.         For i = .RowSel To .Row
  602.             sSql = sSql & " DELETE FROM Rs_ArMain WHERE ArSort = '" & Me.sArSort & "' AND Sno = '" & .TextMatrix(i, 2) & "' AND EmpId = '" & .TextMatrix(i, 1) & "'"
  603.         Next
  604.     Else
  605.         For i = .Row To .RowSel
  606.             sSql = sSql & " DELETE FROM Rs_ArMain WHERE ArSort = '" & Me.sArSort & "' AND Sno = '" & .TextMatrix(i, 2) & "' AND EmpId = '" & .TextMatrix(i, 1) & "'"
  607.         Next
  608.     End If
  609. End With
  610. On Error GoTo ErrDeal
  611. If Trim(sSql) = "" Then Exit Function
  612. Cw_DataEnvi.DataConnect.Execute sSql
  613. DelRecords = True
  614. Exit Function
  615. ErrDeal:
  616.     Call Xtxxts("出现未知情况,该编码不能被删除!", 0, 1)
  617.     
  618. End Function
  619. Private Function Nothing2Edit() As Boolean
  620. '如果该档案的项目只有职工号和姓名2项,认为没有东西可以修改
  621. Dim tmpRs As New ADODB.Recordset
  622. Nothing2Edit = True
  623. Set tmpRs = Cw_DataEnvi.DataConnect.Execute("SELECT ColIndex FROM Xt_Grid WHERE Grid_Code = '" & Me.sArSort & "' AND ColIndex > '002'")
  624. If Not tmpRs.EOF Then
  625.     Nothing2Edit = False
  626. End If
  627. End Function
  628. Public Function ShowRecord(sWhere As String)                                    '生成查询结果(Define)
  629.     '显示数据
  630.     On Error GoTo ErrCtrl
  631.     
  632.     Dim rs As New ADODB.Recordset
  633.     Dim s As String
  634.     Dim i As Long
  635.     Dim j As Long
  636.     Dim m As Long
  637.     Dim n As Long
  638.     
  639.     If Trim(sSqlWhere) = "" Or Trim(sSqlFrom) = "" Then
  640.         Exit Function
  641.     End If
  642.     Me.MousePointer = 11
  643.     GridCode = Me.sArSort
  644.     Call Form_Load
  645.     '取得数据
  646.     s = "select FieldsName as FieldName  from XT_Grid where Grid_Code='" & Me.sArSort & "' and ColIndex<>'000'"
  647.     Set rs = Cw_DataEnvi.DataConnect.Execute(s)
  648.     s = "Select Rs_ArMain.EmpID as EmpID,Rs_ArMain.sNo as sNo " & Chr(10)
  649.     With rs
  650.         Do While Not .EOF()
  651.             s = s & "," & Trim(!FieldName & "") & Chr(10)
  652.             .MoveNext
  653.         Loop
  654.     End With
  655.     rs.Close
  656.         
  657.     With Me.CxbbGrid
  658.         sExec = s & sSqlFrom & Me.sSqlWhere & sSqlOrder
  659.         Set rs = Cw_DataEnvi.DataConnect.Execute(sExec)
  660.         .Rows = .FixedRows + rs.RecordCount
  661.         '初始化进度条
  662.         Me.PB_Proc.Min = .FixedRows
  663.         Me.PB_Proc.Max = .Rows + 1
  664.         Me.PB_Proc.Value = Me.PB_Proc.Min
  665.         Me.PB_Proc.Visible = True
  666.         '填充数据
  667.         s = ""
  668.         .ColHidden(Qslz - 1) = False
  669.         .ColWidth(Qslz - 1) = 800
  670.         .TextMatrix(.FixedRows - 1, Qslz - 1) = "编号"
  671.         .FixedAlignment(Qslz - 1) = flexAlignCenterCenter
  672.         n = 1
  673.         For i = .FixedRows To .Rows - 1
  674.             .RowHeight(i) = Sjhgd
  675.             Me.PB_Proc.Value = i
  676.             If m <> rs.Fields("EmpID") Then
  677.                 n = 1
  678.                 m = rs.Fields("EmpID")
  679.             Else
  680.                 n = n + 1
  681.             End If
  682.             .TextMatrix(i, Qslz - 1) = n
  683.             For j = Qslz To .Cols - 1
  684.                 .TextMatrix(i, j) = Trim(rs.Fields(GridStr(j, 4)) & "")
  685.             Next j
  686.             .TextMatrix(i, 1) = rs.Fields("EmpID")
  687.             .TextMatrix(i, 2) = rs.Fields("sNo")
  688.             rs.MoveNext
  689.         Next i
  690.         rs.Close
  691.         
  692.         
  693.         Me.PB_Proc.Visible = False
  694.         .Redraw = True
  695.     End With
  696.     Set rs = Nothing
  697.     Me.MousePointer = 0
  698.     Exit Function
  699.     
  700. ErrCtrl:
  701.     If rs.State = 1 Then
  702.         rs.Close
  703.     End If
  704.     Set rs = Nothing
  705.     Me.PB_Proc.Visible = False
  706.     Me.CxbbGrid.Redraw = True
  707.     Me.MousePointer = 0
  708.     
  709. End Function
  710. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  711.     
  712.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  713.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  714.     Bbxbtgs = 1                                         '报 表 小 标 题 行 数
  715.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  716.     ReDim Bbxbt(1 To Bbxbtgs)
  717.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  718.     If Bbbwhgs <> 0 Then
  719.         ReDim Bbbwh(1 To Bbbwhgs)
  720.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  721.     End If
  722.     Bbzbt = ReportTitle
  723.     
  724.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  725.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  726.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  727.     If Not bbylte Then
  728.         Unload DY_Tybbyldy
  729.     End If
  730.     
  731. End Sub