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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  4. Begin VB.Form YH_FrmDzd 
  5.    Caption         =   "银行对帐单"
  6.    ClientHeight    =   7260
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   9300
  10.    HelpContextID   =   5102
  11.    Icon            =   "银行_银行对帐单.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MDIChild        =   -1  'True
  14.    ScaleHeight     =   7260
  15.    ScaleWidth      =   9300
  16.    Begin VB.CommandButton Ydcommand 
  17.       Height          =   315
  18.       Left            =   9600
  19.       Picture         =   "银行_银行对帐单.frx":1042
  20.       Style           =   1  'Graphical
  21.       TabIndex        =   1
  22.       Top             =   107
  23.       Visible         =   0   'False
  24.       Width           =   255
  25.    End
  26.    Begin VB.TextBox Ydtext 
  27.       BackColor       =   &H00C0FFFF&
  28.       BorderStyle     =   0  'None
  29.       Height          =   180
  30.       Left            =   8700
  31.       MultiLine       =   -1  'True
  32.       TabIndex        =   2
  33.       Top             =   120
  34.       Visible         =   0   'False
  35.       Width           =   765
  36.    End
  37.    Begin VB.PictureBox Pic_Title 
  38.       BackColor       =   &H00FFFFFF&
  39.       Height          =   1065
  40.       Left            =   30
  41.       Picture         =   "银行_银行对帐单.frx":13CC
  42.       ScaleHeight     =   1005
  43.       ScaleWidth      =   11850
  44.       TabIndex        =   7
  45.       Top             =   570
  46.       Width           =   11910
  47.       Begin VB.TextBox Text_Num 
  48.          Alignment       =   1  'Right Justify
  49.          Height          =   270
  50.          Left            =   10200
  51.          MaxLength       =   5
  52.          TabIndex        =   25
  53.          Text            =   "10"
  54.          Top             =   705
  55.          Width           =   1305
  56.       End
  57.       Begin VB.Label Label4 
  58.          AutoSize        =   -1  'True
  59.          BackStyle       =   0  'Transparent
  60.          Caption         =   "显示记录数:"
  61.          Height          =   180
  62.          Left            =   9210
  63.          TabIndex        =   24
  64.          Top             =   750
  65.          Width           =   990
  66.       End
  67.       Begin VB.Label Label3 
  68.          Appearance      =   0  'Flat
  69.          BackColor       =   &H80000005&
  70.          BorderStyle     =   1  'Fixed Single
  71.          ForeColor       =   &H80000008&
  72.          Height          =   180
  73.          Index           =   1
  74.          Left            =   7215
  75.          TabIndex        =   23
  76.          Top             =   232
  77.          Width           =   390
  78.       End
  79.       Begin VB.Label Lab_Bill 
  80.          Appearance      =   0  'Flat
  81.          AutoSize        =   -1  'True
  82.          BackColor       =   &H80000005&
  83.          BackStyle       =   0  'Transparent
  84.          Caption         =   "未勾对"
  85.          ForeColor       =   &H00000000&
  86.          Height          =   180
  87.          Index           =   1
  88.          Left            =   7695
  89.          TabIndex        =   22
  90.          Top             =   232
  91.          Width           =   540
  92.       End
  93.       Begin VB.Label Label3 
  94.          Appearance      =   0  'Flat
  95.          BackColor       =   &H00E9FC61&
  96.          BorderStyle     =   1  'Fixed Single
  97.          ForeColor       =   &H80000008&
  98.          Height          =   180
  99.          Index           =   0
  100.          Left            =   6090
  101.          TabIndex        =   21
  102.          Top             =   232
  103.          Width           =   390
  104.       End
  105.       Begin VB.Label Lab_Bill 
  106.          Appearance      =   0  'Flat
  107.          AutoSize        =   -1  'True
  108.          BackColor       =   &H80000005&
  109.          BackStyle       =   0  'Transparent
  110.          Caption         =   "已勾对"
  111.          ForeColor       =   &H00000000&
  112.          Height          =   180
  113.          Index           =   0
  114.          Left            =   6555
  115.          TabIndex        =   20
  116.          Top             =   232
  117.          Width           =   540
  118.       End
  119.       Begin VB.Label Lab_kjbm 
  120.          AutoSize        =   -1  'True
  121.          BackStyle       =   0  'Transparent
  122.          Height          =   180
  123.          Left            =   1680
  124.          TabIndex        =   19
  125.          Top             =   750
  126.          Width           =   90
  127.       End
  128.       Begin VB.Label Lab_kjkm 
  129.          Appearance      =   0  'Flat
  130.          AutoSize        =   -1  'True
  131.          BackColor       =   &H80000005&
  132.          BackStyle       =   0  'Transparent
  133.          Caption         =   "银行科目:"
  134.          ForeColor       =   &H00000000&
  135.          Height          =   180
  136.          Index           =   0
  137.          Left            =   795
  138.          TabIndex        =   18
  139.          Top             =   750
  140.          Width           =   810
  141.       End
  142.       Begin VB.Label TsLabel 
  143.          AutoSize        =   -1  'True
  144.          BackStyle       =   0  'Transparent
  145.          Caption         =   "当前记录"
  146.          Height          =   180
  147.          Index           =   13
  148.          Left            =   9210
  149.          TabIndex        =   17
  150.          Top             =   232
  151.          Width           =   720
  152.       End
  153.       Begin VB.Label TsLabel 
  154.          AutoSize        =   -1  'True
  155.          BackStyle       =   0  'Transparent
  156.          Caption         =   "行)"
  157.          Height          =   180
  158.          Index           =   12
  159.          Left            =   10575
  160.          TabIndex        =   16
  161.          Top             =   232
  162.          Width           =   270
  163.       End
  164.       Begin VB.Label TsLabel 
  165.          AutoSize        =   -1  'True
  166.          BackStyle       =   0  'Transparent
  167.          Caption         =   "(第"
  168.          Height          =   180
  169.          Index           =   11
  170.          Left            =   9960
  171.          TabIndex        =   15
  172.          Top             =   232
  173.          Width           =   270
  174.       End
  175.       Begin VB.Label Lab_Row 
  176.          Alignment       =   2  'Center
  177.          Appearance      =   0  'Flat
  178.          AutoSize        =   -1  'True
  179.          BackColor       =   &H80000005&
  180.          BackStyle       =   0  'Transparent
  181.          ForeColor       =   &H00000000&
  182.          Height          =   180
  183.          Left            =   10365
  184.          TabIndex        =   14
  185.          Top             =   232
  186.          Width           =   90
  187.       End
  188.       Begin VB.Label Lab_kjkm 
  189.          Appearance      =   0  'Flat
  190.          AutoSize        =   -1  'True
  191.          BackColor       =   &H80000005&
  192.          BackStyle       =   0  'Transparent
  193.          Caption         =   "承前余额:"
  194.          ForeColor       =   &H00000000&
  195.          Height          =   180
  196.          Index           =   1
  197.          Left            =   6930
  198.          TabIndex        =   13
  199.          Top             =   750
  200.          Width           =   810
  201.       End
  202.       Begin VB.Label Label2 
  203.          AutoSize        =   -1  'True
  204.          BackStyle       =   0  'Transparent
  205.          Height          =   180
  206.          Index           =   0
  207.          Left            =   7860
  208.          TabIndex        =   12
  209.          Top             =   750
  210.          Width           =   90
  211.       End
  212.       Begin VB.Label Label1 
  213.          AutoSize        =   -1  'True
  214.          BackStyle       =   0  'Transparent
  215.          Height          =   180
  216.          Left            =   5880
  217.          TabIndex        =   11
  218.          Top             =   750
  219.          Width           =   90
  220.       End
  221.       Begin VB.Label TsLabel 
  222.          AutoSize        =   -1  'True
  223.          BackStyle       =   0  'Transparent
  224.          Caption         =   "会计期间:"
  225.          Height          =   180
  226.          Index           =   9
  227.          Left            =   5070
  228.          TabIndex        =   10
  229.          Top             =   750
  230.          Width           =   810
  231.       End
  232.       Begin VB.Label TsLabel 
  233.          AutoSize        =   -1  'True
  234.          BackColor       =   &H80000018&
  235.          BackStyle       =   0  'Transparent
  236.          Caption         =   "银行对帐单录入"
  237.          BeginProperty Font 
  238.             Name            =   "宋体"
  239.             Size            =   14.25
  240.             Charset         =   134
  241.             Weight          =   700
  242.             Underline       =   0   'False
  243.             Italic          =   0   'False
  244.             Strikethrough   =   0   'False
  245.          EndProperty
  246.          ForeColor       =   &H00000000&
  247.          Height          =   285
  248.          Index           =   4
  249.          Left            =   495
  250.          TabIndex        =   9
  251.          Top             =   180
  252.          Width           =   2100
  253.       End
  254.       Begin VB.Label Lab_TitleText 
  255.          AutoSize        =   -1  'True
  256.          BackStyle       =   0  'Transparent
  257.          ForeColor       =   &H00FF0000&
  258.          Height          =   180
  259.          Index           =   0
  260.          Left            =   3060
  261.          TabIndex        =   8
  262.          Top             =   240
  263.          Width           =   90
  264.       End
  265.    End
  266.    Begin MSComctlLib.Toolbar Tlb_Action 
  267.       Align           =   1  'Align Top
  268.       Height          =   555
  269.       Left            =   0
  270.       TabIndex        =   0
  271.       Top             =   0
  272.       Width           =   9300
  273.       _ExtentX        =   16404
  274.       _ExtentY        =   979
  275.       ButtonWidth     =   820
  276.       ButtonHeight    =   926
  277.       AllowCustomize  =   0   'False
  278.       Wrappable       =   0   'False
  279.       Appearance      =   1
  280.       Style           =   1
  281.       ImageList       =   "ImageList1"
  282.       _Version        =   393216
  283.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  284.          NumButtons      =   9
  285.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  286.             Caption         =   "设置"
  287.             Key             =   "ymsz"
  288.             Object.ToolTipText     =   "打印页面设置"
  289.             ImageKey        =   "sz"
  290.          EndProperty
  291.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  292.             Caption         =   "打印"
  293.             Key             =   "dy"
  294.             Object.ToolTipText     =   "打印当前单据或Ctrl+P"
  295.             ImageKey        =   "dy"
  296.          EndProperty
  297.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  298.             Caption         =   "预览"
  299.             Key             =   "yl"
  300.             ImageKey        =   "yl"
  301.          EndProperty
  302.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  303.             Style           =   3
  304.          EndProperty
  305.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  306.             Caption         =   "增行"
  307.             Key             =   "zh"
  308.             Object.ToolTipText     =   "插入一行或Insert"
  309.             ImageKey        =   "zh"
  310.          EndProperty
  311.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  312.             Caption         =   "删行"
  313.             Key             =   "sh"
  314.             Object.ToolTipText     =   "删除当前记录行或Delete"
  315.             ImageKey        =   "sh"
  316.          EndProperty
  317.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  318.             Key             =   "fgh1"
  319.             Style           =   3
  320.          EndProperty
  321.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  322.             Caption         =   "帮助"
  323.             Key             =   "bz"
  324.             ImageKey        =   "bz"
  325.          EndProperty
  326.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  327.             Caption         =   "退出"
  328.             Key             =   "fh"
  329.             ImageKey        =   "tc"
  330.          EndProperty
  331.       EndProperty
  332.       BorderStyle     =   1
  333.       Begin MSComctlLib.Toolbar GsToolbar 
  334.          Height          =   540
  335.          Left            =   10200
  336.          TabIndex        =   28
  337.          Top             =   0
  338.          Width           =   1665
  339.          _ExtentX        =   2937
  340.          _ExtentY        =   953
  341.          ButtonWidth     =   1455
  342.          ButtonHeight    =   953
  343.          AllowCustomize  =   0   'False
  344.          Appearance      =   1
  345.          Style           =   1
  346.          ImageList       =   "ImageList1"
  347.          _Version        =   393216
  348.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  349.             NumButtons      =   2
  350.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  351.                Caption         =   "保存格式"
  352.                Key             =   "bcgs"
  353.                ImageKey        =   "bcgs"
  354.             EndProperty
  355.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  356.                Caption         =   "默认列宽"
  357.                Key             =   "hfmrgs"
  358.                ImageKey        =   "mrlk"
  359.             EndProperty
  360.          EndProperty
  361.       End
  362.       Begin VB.ComboBox YdCombo 
  363.          Height          =   300
  364.          Left            =   7260
  365.          Style           =   2  'Dropdown List
  366.          TabIndex        =   26
  367.          Top             =   60
  368.          Visible         =   0   'False
  369.          Width           =   1665
  370.       End
  371.       Begin MSComctlLib.ImageList ImageList1 
  372.          Left            =   6300
  373.          Top             =   0
  374.          _ExtentX        =   1005
  375.          _ExtentY        =   1005
  376.          BackColor       =   -2147483643
  377.          ImageWidth      =   16
  378.          ImageHeight     =   16
  379.          MaskColor       =   12632256
  380.          _Version        =   393216
  381.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  382.             NumListImages   =   32
  383.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  384.                Picture         =   "银行_银行对帐单.frx":1E30C
  385.                Key             =   "sz"
  386.             EndProperty
  387.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  388.                Picture         =   "银行_银行对帐单.frx":1E6A6
  389.                Key             =   "dy"
  390.             EndProperty
  391.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  392.                Picture         =   "银行_银行对帐单.frx":1EA40
  393.                Key             =   "yl"
  394.             EndProperty
  395.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  396.                Picture         =   "银行_银行对帐单.frx":1EDDA
  397.                Key             =   "xg"
  398.             EndProperty
  399.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  400.                Picture         =   "银行_银行对帐单.frx":1F174
  401.                Key             =   "zh"
  402.             EndProperty
  403.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  404.                Picture         =   "银行_银行对帐单.frx":1F50E
  405.                Key             =   "sh"
  406.             EndProperty
  407.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  408.                Picture         =   "银行_银行对帐单.frx":1F8A8
  409.                Key             =   "bc"
  410.             EndProperty
  411.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  412.                Picture         =   "银行_银行对帐单.frx":1FC42
  413.                Key             =   "fq"
  414.             EndProperty
  415.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  416.                Picture         =   "银行_银行对帐单.frx":1FFDC
  417.                Key             =   "bz"
  418.             EndProperty
  419.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  420.                Picture         =   "银行_银行对帐单.frx":20376
  421.                Key             =   "tc"
  422.             EndProperty
  423.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  424.                Picture         =   "银行_银行对帐单.frx":20710
  425.                Key             =   "bcgs"
  426.             EndProperty
  427.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  428.                Picture         =   "银行_银行对帐单.frx":20AAA
  429.                Key             =   "mrlk"
  430.             EndProperty
  431.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  432.                Picture         =   "银行_银行对帐单.frx":20E44
  433.                Key             =   "xsxm"
  434.             EndProperty
  435.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  436.                Picture         =   "银行_银行对帐单.frx":211DE
  437.                Key             =   "first"
  438.             EndProperty
  439.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  440.                Picture         =   "银行_银行对帐单.frx":21578
  441.                Key             =   "prev"
  442.             EndProperty
  443.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  444.                Picture         =   "银行_银行对帐单.frx":21912
  445.                Key             =   "next"
  446.             EndProperty
  447.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  448.                Picture         =   "银行_银行对帐单.frx":21CAC
  449.                Key             =   "last"
  450.             EndProperty
  451.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  452.                Picture         =   "银行_银行对帐单.frx":22046
  453.                Key             =   "xx"
  454.             EndProperty
  455.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  456.                Picture         =   "银行_银行对帐单.frx":223E0
  457.                Key             =   "define"
  458.             EndProperty
  459.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  460.                Picture         =   "银行_银行对帐单.frx":2277A
  461.                Key             =   "exec"
  462.             EndProperty
  463.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  464.                Picture         =   "银行_银行对帐单.frx":22B14
  465.                Key             =   "xz"
  466.             EndProperty
  467.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  468.                Picture         =   "银行_银行对帐单.frx":22EAE
  469.                Key             =   "sc"
  470.             EndProperty
  471.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  472.                Picture         =   "银行_银行对帐单.frx":23248
  473.                Key             =   "sx"
  474.             EndProperty
  475.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  476.                Picture         =   "银行_银行对帐单.frx":235E2
  477.                Key             =   "cx"
  478.             EndProperty
  479.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  480.                Picture         =   "银行_银行对帐单.frx":2397C
  481.                Key             =   "zd"
  482.             EndProperty
  483.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  484.                Picture         =   "银行_银行对帐单.frx":23D16
  485.                Key             =   "dz"
  486.             EndProperty
  487.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  488.                Picture         =   "银行_银行对帐单.frx":240B0
  489.                Key             =   "ph"
  490.             EndProperty
  491.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  492.                Picture         =   "银行_银行对帐单.frx":2444A
  493.                Key             =   "fz"
  494.             EndProperty
  495.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  496.                Picture         =   "银行_银行对帐单.frx":247E4
  497.                Key             =   "dw"
  498.             EndProperty
  499.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  500.                Picture         =   "银行_银行对帐单.frx":24B7E
  501.                Key             =   "hf"
  502.             EndProperty
  503.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  504.                Picture         =   "银行_银行对帐单.frx":24F18
  505.                Key             =   "pz"
  506.             EndProperty
  507.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  508.                Picture         =   "银行_银行对帐单.frx":252B2
  509.                Key             =   "check"
  510.             EndProperty
  511.          EndProperty
  512.       End
  513.       Begin VB.Label Label5 
  514.          BackColor       =   &H000080FF&
  515.          Caption         =   "1"
  516.          Height          =   345
  517.          Left            =   8640
  518.          TabIndex        =   27
  519.          Top             =   -360
  520.          Visible         =   0   'False
  521.          Width           =   345
  522.       End
  523.    End
  524.    Begin VSFlex8Ctl.VSFlexGrid WglrGrid 
  525.       Height          =   5895
  526.       Left            =   30
  527.       TabIndex        =   3
  528.       Top             =   1710
  529.       Width           =   11895
  530.       _cx             =   5080
  531.       _cy             =   5080
  532.       Appearance      =   1
  533.       BorderStyle     =   1
  534.       Enabled         =   -1  'True
  535.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  536.          Name            =   "宋体"
  537.          Size            =   9
  538.          Charset         =   134
  539.          Weight          =   400
  540.          Underline       =   0   'False
  541.          Italic          =   0   'False
  542.          Strikethrough   =   0   'False
  543.       EndProperty
  544.       MousePointer    =   0
  545.       BackColor       =   -2147483643
  546.       ForeColor       =   -2147483640
  547.       BackColorFixed  =   12640511
  548.       ForeColorFixed  =   -2147483630
  549.       BackColorSel    =   -2147483643
  550.       ForeColorSel    =   -2147483640
  551.       BackColorBkg    =   -2147483636
  552.       BackColorAlternate=   -2147483643
  553.       GridColor       =   -2147483633
  554.       GridColorFixed  =   -2147483632
  555.       TreeColor       =   -2147483632
  556.       FloodColor      =   192
  557.       SheetBorder     =   -2147483642
  558.       FocusRect       =   1
  559.       HighLight       =   1
  560.       AllowSelection  =   0   'False
  561.       AllowBigSelection=   0   'False
  562.       AllowUserResizing=   0
  563.       SelectionMode   =   0
  564.       GridLines       =   1
  565.       GridLinesFixed  =   2
  566.       GridLineWidth   =   1
  567.       Rows            =   5000
  568.       Cols            =   20
  569.       FixedRows       =   1
  570.       FixedCols       =   0
  571.       RowHeightMin    =   0
  572.       RowHeightMax    =   0
  573.       ColWidthMin     =   0
  574.       ColWidthMax     =   0
  575.       ExtendLastCol   =   0   'False
  576.       FormatString    =   ""
  577.       ScrollTrack     =   0   'False
  578.       ScrollBars      =   3
  579.       ScrollTips      =   0   'False
  580.       MergeCells      =   0
  581.       MergeCompare    =   0
  582.       AutoResize      =   -1  'True
  583.       AutoSizeMode    =   0
  584.       AutoSearch      =   0
  585.       AutoSearchDelay =   2
  586.       MultiTotals     =   -1  'True
  587.       SubtotalPosition=   1
  588.       OutlineBar      =   0
  589.       OutlineCol      =   0
  590.       Ellipsis        =   0
  591.       ExplorerBar     =   0
  592.       PicturesOver    =   0   'False
  593.       FillStyle       =   0
  594.       RightToLeft     =   0   'False
  595.       PictureType     =   0
  596.       TabBehavior     =   0
  597.       OwnerDraw       =   0
  598.       Editable        =   0
  599.       ShowComboButton =   1
  600.       WordWrap        =   -1  'True
  601.       TextStyle       =   0
  602.       TextStyleFixed  =   0
  603.       OleDragMode     =   0
  604.       OleDropMode     =   0
  605.       DataMode        =   0
  606.       VirtualData     =   -1  'True
  607.       DataMember      =   ""
  608.       ComboSearch     =   3
  609.       AutoSizeMouse   =   -1  'True
  610.       FrozenRows      =   0
  611.       FrozenCols      =   0
  612.       AllowUserFreezing=   0
  613.       BackColorFrozen =   0
  614.       ForeColorFrozen =   0
  615.       WallPaperAlignment=   9
  616.       AccessibleName  =   ""
  617.       AccessibleDescription=   ""
  618.       AccessibleValue =   ""
  619.       AccessibleRole  =   24
  620.    End
  621.    Begin VB.Label Lab_Book 
  622.       Appearance      =   0  'Flat
  623.       BackColor       =   &H80000005&
  624.       BackStyle       =   0  'Transparent
  625.       ForeColor       =   &H000000FF&
  626.       Height          =   373
  627.       Left            =   3946
  628.       TabIndex        =   6
  629.       Top             =   11449
  630.       Width           =   888
  631.    End
  632.    Begin VB.Label Lab_OperStatus 
  633.       BackColor       =   &H000080FF&
  634.       Caption         =   "1"
  635.       Height          =   180
  636.       Left            =   7106
  637.       TabIndex        =   5
  638.       Top             =   690
  639.       Visible         =   0   'False
  640.       Width           =   880
  641.    End
  642.    Begin VB.Label Lab_Pzclzt 
  643.       BackColor       =   &H0000FFFF&
  644.       Caption         =   "1"
  645.       ForeColor       =   &H00808080&
  646.       Height          =   420
  647.       Left            =   9268
  648.       TabIndex        =   4
  649.       Top             =   660
  650.       Visible         =   0   'False
  651.       Width           =   367
  652.    End
  653. End
  654. Attribute VB_Name = "YH_FrmDzd"
  655. Attribute VB_GlobalNameSpace = False
  656. Attribute VB_Creatable = False
  657. Attribute VB_PredeclaredId = True
  658. Attribute VB_Exposed = False
  659. '*********************************************************************************************************
  660. '*    模 块 名 称 :银行对帐单
  661. '*    功 能 描 述 :此功能模块主要完成银行对帐单新增修改
  662. '*    程序员姓名  :xjl
  663. '*    最后修改人  :xjl
  664. '*    最后修改时间:2001/07/13
  665. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  666. '*
  667. '*********************************************************************************************************
  668.  
  669. '其它固定使用变量
  670. Dim Tsxx As String                              '系统信息提示(Fixed)
  671. Dim ReportTitle As String                       '报表主标题(Fixed)
  672. Dim Str_RightEdit As String                     '编辑权限索引
  673.     
  674. '以下为固定使用变量(网格)
  675. Dim Cxnrrec As New ADODB.Recordset              '显示查询内容动态集
  676. Dim Dyymctbl As New DY_Dyymsz                   '打印页面窗体变量
  677. Dim GridCode As String                          '显示网格网格代码
  678. Dim GridInf() As Variant                        '整个网格设置信息
  679. Dim Pmbcsjhs As Long                            '屏幕网格保持数据行数(大于等于1)
  680. Dim Fzxwghs As Integer                          '辅助项网格行数(包括合计行)
  681. Dim Sfxshjwg As Boolean                         '是否显示合计网格
  682. Dim Qslz As Long                                '网格隐藏(非操作显示)列数
  683. Dim Sjhgd As Double                             '网格数据行高度
  684. Dim GridBoolean() As Boolean                    '网格列信息(布尔型)
  685. Dim GridStr()  As String                        '网格列信息(字符型)
  686. Dim GridInt() As Integer                        '网格列信息(整型)
  687. Dim Sfblbzkd As Boolean                         '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
  688. Dim Dqlrwgh As Long                             '当前录入数据网格行
  689. Dim Dqlrwgl As Long                             '当前录入数据网格列
  690. Dim Dqlkwgh As Long                             '刚刚离开网格行(不一定为录入行)
  691. Dim Dqlkwgl As Long                             '刚刚离开网格列
  692. Dim Dqtoprow As Long                            '当前录入状态时最上端可视行
  693. Dim Dqleftcol As Long                           '当前录入状态时最左端可视列
  694. Dim Zdlrqnr As String                           '字段录入修改前内容(用来判断内容是否修改)
  695. Dim Wbkbhlock As Boolean                        '文本框改变值锁
  696. Dim changelock As Boolean                       '网格行列改变控制锁(用来区别用户改变.程序改变)
  697. Dim Gdtlock As Boolean                          '滚动条滚动控制(用来区别用户改变.程序改变)
  698. Dim Yxxpdlock As Boolean                        '字段有效性判断锁(内容不修改不需进行字段有效性判断)
  699. Dim Hyxxpdlock As Boolean                       '行有效性判断锁(字段内容不修改不需进行行有效性判断)
  700. Dim Valilock As Boolean                         '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
  701. Dim Shsfts As Boolean                           '删除记录行是否提示
  702. Dim Szzls As Integer                            '网格信息数组最大下标值(网格列数-1)
  703.     
  704. Private Sub Form_KeyPress(KeyAscii As Integer)      '控制焦点转移和限制录入字符"'"
  705.     
  706.     Select Case KeyAscii
  707.     Case 39           '屏蔽字符"'"
  708.         KeyAscii = 0
  709.     End Select
  710.     
  711. End Sub
  712. Sub Form_Load()                              '窗体装入
  713.     
  714.     '初始化各种锁值(Fixed)
  715.     changelock = False             '网格行列改变控制锁
  716.     Gdtlock = False                '滚动条滚动控制
  717.     Yxxpdlock = True               '字段有效性判断锁
  718.     Hyxxpdlock = True              '行有效性判断锁
  719.     Wbkbhlock = False              '文本框内容改变锁
  720.     
  721.     '隐藏选择对话框
  722.     YH_FrmXzkm.Hide
  723.     '定义会计区间
  724.     Label1.Caption = Mid(Trim(Str(10000 + Xtyear)), 2, 4) + "." + Mid(Trim(Str(100 + Xtmm)), 2, 2)
  725.     '设置会计科目
  726.     Lab_kjbm.Caption = YH_FrmXzkm.Combo1.Text
  727.     
  728.     '设置调整前余额
  729.     Sqlstr = "SELECT * FROM CWZZ_BankBill Where RecType=0 And Ccode='" & Val(YH_FrmXzkm.Combo1.Text) & "'"
  730.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  731.     If Cxnrrec.EOF = False Then
  732.         If Val(Cxnrrec.Fields("Dfje")) = 0 Then
  733.             Label2(0).Caption = "0"
  734.         Else
  735.             Label2(0).Caption = Format(Cxnrrec.Fields("Dfje"), "#,###.00")
  736.         End If
  737.     Else
  738.         Label2(0).Caption = 0
  739.     End If
  740.     
  741.     '报表主标题及报表编码
  742.     ReportTitle = "银行对帐单"
  743.     XtReportCode = "Cwzz_yhdzd"
  744.     Load Dyymctbl
  745.     
  746.     '调入网格(Fixed)
  747.     GridCode = "Cwzz_yhdzdlr"      '网格属性编码
  748.     Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  749.     
  750.     Qslz = GridInf(1)
  751.     Sjhgd = GridInf(2)
  752.     Pmbcsjhs = GridInf(3)
  753.     Fzxwghs = GridInf(4)
  754.     Sfblbzkd = GridInf(5)
  755.     Shsfts = GridInf(6)
  756.     Sfxshjwg = GridInf(7)
  757.     Szzls = WglrGrid.Cols - 1
  758.     
  759.     '生成查询结果
  760.     Call Sub_Query
  761.     
  762.     '设置状态为修改状态
  763.     Lab_OperStatus = "2"
  764.     
  765.     '调整标题位置
  766.     SetTitlePos tsLabel(4)
  767.     Str_RightEdit = "Cwzz_yhdzd_Edit"
  768.     
  769.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  770.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
  771.         Lab_OperStatus = "1"
  772.     End If
  773.     
  774. End Sub
  775. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  776.     If Fun_Drfrmyxxpd = True Then
  777.         
  778.     Else
  779.         Cancel = 1
  780.     End If
  781. End Sub
  782. Private Sub Form_Unload(Cancel As Integer)           '窗体卸载
  783.     
  784.     '卸载打印页面窗体
  785.     Unload Dyymctbl
  786.     
  787. End Sub
  788. Private Sub Sub_Query()                              '生成查询结果
  789.     
  790.     Dim Sqlstr As String                           '临时使用字符串
  791.     Dim RecTemp As New ADODB.Recordset             '临时使用动态集
  792.     Dim Jsqte As Long                              '临时计数器
  793.     
  794.     '禁止网格刷新动作,为加快网格显示速度(Fixed)
  795.     WglrGrid.Redraw = False
  796.     
  797.     '查询银行对帐单
  798.     Sqlstr = "SELECT * FROM CWZZ_BankBill  Where BankBillID in(Select top " + Text_Num + " BankBillID from cwzz_bankbill where Ccode='" & Val(Lab_kjbm) & "' And  " _
  799.     & "RecType=2 Order By BillDate desc) Order By BillDate"
  800.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  801.     
  802.     With RecTemp
  803.         WglrGrid.Rows = WglrGrid.FixedRows
  804.         Jsqte = WglrGrid.FixedRows
  805.         
  806.         Do While Not .EOF
  807.             
  808.             WglrGrid.AddItem ""
  809.             WglrGrid.TextMatrix(Jsqte, 0) = "*"
  810.             WglrGrid.TextMatrix(Jsqte, 1) = .Fields("BankBillID")                                                   '对帐单ID
  811.             WglrGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Format(.Fields("billdate"), "yyyy-mm-dd")   '票据日期
  812.             Sqlstr = "Select * From Gy_SetTleMent Where Sscode='" & .Fields!sscode & "'"                           '结算方式
  813.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  814.             If Cxnrrec.EOF = False Then
  815.                 WglrGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(Cxnrrec.Fields("ssname") & "")
  816.             End If
  817.             WglrGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("BillNo") & "")                '票号
  818.             If Val(.Fields("Jfje")) <> 0 Then
  819.                 WglrGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(Str(.Fields("Jfje")))              '借方金额
  820.             End If
  821.             If Val(.Fields("dfje")) <> 0 Then
  822.                 WglrGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(Str(.Fields("Dfje")))              '贷方金额
  823.             End If
  824.             WglrGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("Digest")) & ""                '摘要
  825.             If .Fields("bcheckflag") = True Then                                                                    '如果已勾对设置网格颜色
  826.                 WglrGrid.Cell(flexcpBackColor, Jsqte, 0, Jsqte, WglrGrid.Cols - 1) = Label3(0).BackColor
  827.             End If
  828.             WglrGrid.RowHeight(Jsqte) = Sjhgd
  829.             .MoveNext
  830.             Jsqte = Jsqte + 1
  831.         Loop
  832.     End With
  833.     
  834.     '将网格刷新解禁(Fixed)
  835.     WglrGrid.Redraw = True
  836.     
  837.     '调整网格(Fixed)
  838.     Call Sub_AdjustGrid
  839.     '计算合计数据
  840.     Call Sjhj
  841. End Sub
  842. Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button)             '用户点击工具条
  843.     
  844.     '屏蔽文本框,下拉组合框有效性判断
  845.     
  846.     Valilock = True
  847.     
  848.     '屏蔽网格失去焦点产生的有效性判断
  849.     
  850.     changelock = True
  851.     
  852.     Select Case Button.Key
  853.     Case "ymsz"                                          '页面设置
  854.         Dyymctbl.Show 1
  855.     Case "yl"                                            '预 览
  856.         If Fun_Drfrmyxxpd Then
  857.             Call bbyl(True)
  858.         End If
  859.     Case "dy"                                            '打 印
  860.         If Fun_Drfrmyxxpd Then
  861.             Call bbyl(False)
  862.         End If
  863.     Case "zh"                                            '增 行
  864.         Call zjlrfl
  865.     Case "sh"                                            '删 行
  866.         Call Scdqfl
  867.     Case "bz"                                            '帮 助
  868.         Call F1bz
  869.     Case "fh"                                            '退 出
  870.         Unload Me
  871.     End Select
  872.     
  873.     '解 锁
  874.     Valilock = False
  875.     changelock = False
  876.     
  877. End Sub
  878. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  879.     
  880.     If Shift = 2 Then
  881.         Select Case UCase(Chr(KeyCode))
  882.         Case "P"                   'Ctrl+P 打印
  883.             If Tlb_Action.Buttons("dy").Enabled Then
  884.                 Call bbyl(False)
  885.             End If
  886.         End Select
  887.     End If
  888.     
  889. End Sub
  890. Private Sub Wbkcl()                                                 '文本框录入之前处理(根据实际情况)
  891.     
  892.     Dim xswbrr As String
  893.     
  894.     With WglrGrid
  895.         Zdlrqnr = Trim(.Text)
  896.         xswbrr = Trim(.Text)
  897.         
  898.         If GridBoolean(.Col, 3) Then   '列表框录入
  899.             
  900.             '填充列表框程序
  901.             Call FillCombo(YdCombo, GridStr(.Col, 5), xswbrr, 0)
  902.         Else
  903.             Wbkbhlock = True
  904.             
  905.             '====以下为用户自定义
  906.             Ydtext.Text = xswbrr
  907.             '====以上为用户自定义
  908.             
  909.             Wbkbhlock = False
  910.             Ydtext.SelStart = Len(Ydtext.Text)
  911.         End If
  912.     End With
  913.     
  914. End Sub
  915. Private Function sjzdyxxpd(Dqpdwgh As Long, Dqpdwgl As Long) As Boolean       '录入数据字段有效性判断,同时进行字段录入事后处理
  916.     '函数参数:Dqpdwgh, Dqpdwgl 当前要判断网格单元所处行列值
  917.     
  918.     Dim Str_JudgeText As String                 '临时有效性判断字段内容(Fixed)
  919.     Dim Coljsq As Long                          '临时列计数器(Fixed)
  920.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集(Fixed)
  921.     Dim Sqlstr As String                        '临时使用查询字符串(Fixed)
  922.     
  923.     With WglrGrid
  924.         
  925.         '非录入状态或非数据行则其有效性为合法(Fixed)
  926.         If Yxxpdlock Or .Row < .FixedRows Then
  927.             sjzdyxxpd = True
  928.             Exit Function
  929.         End If
  930.         
  931.         '取得当前要判断字段内容(Fixed)
  932.         Str_JudgeText = Trim(.TextMatrix(Dqpdwgh, Dqpdwgl))
  933.         
  934.         '根据不同字段进行相应的处理(依据其逻辑编号)
  935.         Select Case GridStr(Dqpdwgl, 1)
  936.             '[>>以下为自定义部分
  937.             
  938.         Case "001"          '日期格式(如用户录入日期格式正确)
  939.             If Trim(Str_JudgeText) <> "" Then
  940.                 If Not IsDate(Str_JudgeText) = True Then
  941.                     Tsxx = "此日期格式不正确!"
  942.                     GoTo Lrcwcl
  943.                 Else
  944.                     Sqlstr = "select * from cwzz_bankbill where rectype=0 and ccode='" & Val(Lab_kjbm.Caption) & "'"
  945.                     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  946.                     If RecTemp.EOF = False Then
  947.                         If Str_JudgeText < Format(RecTemp.Fields("billdate"), "yyyy-mm-dd") Then
  948.                             Tsxx = "日期不能小于启用日期!"
  949.                             GoTo Lrcwcl
  950.                         End If
  951.                     End If
  952.                 End If
  953.             End If
  954.         Case "002"
  955.             If Trim(Str_JudgeText) <> "" Then
  956.                 If Val(Str_JudgeText) <> 0 Then
  957.                     Sqlstr = "Select * from Gy_settlement where sscode='" & Str_JudgeText & "'"
  958.                     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  959.                     With RecTemp
  960.                         If .EOF Then
  961.                             Tsxx = "此编码不存在!"
  962.                             GoTo Lrcwcl
  963.                         End If
  964.                         WglrGrid.TextMatrix(Dqpdwgh, Sydz("002", GridStr(), Szzls)) = RecTemp.Fields("ssname")
  965.                     End With
  966.                 End If
  967.                 If Val(Str_JudgeText) = 0 Then
  968.                     Sqlstr = "Select * from Gy_settlement where ssname='" & Str_JudgeText & "'"
  969.                     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  970.                     With RecTemp
  971.                         If .EOF Then
  972.                             Tsxx = "此编码不存在!"
  973.                             GoTo Lrcwcl
  974.                         End If
  975.                     End With
  976.                 End If
  977.             End If
  978.         Case "004"     '借方金额
  979.             '用户如录入借方金额,系统则自动清除贷方金额
  980.             If Val(WglrGrid.TextMatrix(Dqpdwgh, Dqpdwgl)) <> 0 Then
  981.                 WglrGrid.TextMatrix(Dqpdwgh, Sydz("005", GridStr(), Szzls)) = ""
  982.             End If
  983.         Case "005"     '贷方金额
  984.             '用户如录入贷方金额,系统则自动清除借方金额
  985.             If Val(WglrGrid.TextMatrix(Dqpdwgh, Dqpdwgl)) <> 0 Then
  986.                 WglrGrid.TextMatrix(Dqpdwgh, Sydz("004", GridStr(), Szzls)) = ""
  987.             End If
  988.             '<<以上为自定义部分]
  989.         End Select
  990.         
  991.         '字段录入正确后为零字段清空(Fixed)
  992.         Call Qkwlzd(Dqpdwgh, Dqpdwgl)
  993.         
  994.         '字段录入正确后进行数据合计
  995.         Call Sjhj
  996.         
  997.         '字段有效性判断通过,将字段有效性判断加锁直至再次改变(Fixed)
  998.         sjzdyxxpd = True
  999.         Yxxpdlock = True
  1000.         Exit Function
  1001.     End With
  1002.     
  1003. Lrcwcl:    '录入错误处理(Fixed)
  1004.     
  1005.     With WglrGrid
  1006.         '给出错误提示信息
  1007.         Call Xtxxts(Tsxx, 0, 1)
  1008.         
  1009.         '返回网格错误位置(ChangeLock避免再次引发RowColChange有效性判断),装入录入载体
  1010.         changelock = True
  1011.         .Select Dqpdwgh, Dqpdwgl
  1012.         changelock = False
  1013.         Call xswbk
  1014.         
  1015.         '函数返回False
  1016.         sjzdyxxpd = False
  1017.         Exit Function
  1018.     End With
  1019.     
  1020. End Function
  1021. Private Function Sjhzyxxpd(ByVal Yxxpdh As Long) As Boolean                  '录入数据行有效性判断,同时进行行处理
  1022.     
  1023.     Dim Lrywlz As Long                     '录入错误列值(Fixed)
  1024.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  1025.     Dim Sqlstr As String                   '临时查询字符串
  1026.     
  1027.     With WglrGrid
  1028.         
  1029.         '判断行为空和无效数据行则清除当前行
  1030.         If Yxxpdh > (.Rows - .FixedRows) Then Exit Function
  1031.         If .TextMatrix(Yxxpdh, 0) <> "*" Then
  1032.             Sjhzyxxpd = True
  1033.             Exit Function
  1034.         Else
  1035.             If pdhwk(Yxxpdh) And Yxxpdh + 1 <= .Rows - 1 Then
  1036.                 If .TextMatrix(Yxxpdh + 1, 0) <> "*" Then
  1037.                     changelock = True
  1038.                     .RemoveItem Yxxpdh
  1039.                     
  1040.                     If .Rows < Pmbcsjhs + .FixedRows + Fzxwghs + 1 Then
  1041.                         .AddItem ""
  1042.                         .RowHeight(.Rows - 1) = Sjhgd
  1043.                     End If
  1044.                     
  1045.                     changelock = False
  1046.                     Sjhzyxxpd = True
  1047.                     Exit Function
  1048.                 End If
  1049.             End If
  1050.         End If
  1051.         
  1052.         '行没有发生变化则不进行有效性判断
  1053.         If Hyxxpdlock Then
  1054.             Sjhzyxxpd = True
  1055.             Exit Function
  1056.         End If
  1057.         
  1058.         '以下为自定义部分[
  1059.         
  1060.         '1.1首先进行单个不能为空或不能为零判断(Fixed)
  1061.         For Jsqte = Qslz To .Cols - 1
  1062.             
  1063.             '字段不能为空
  1064.             If GridInt(Jsqte, 5) = 1 Then
  1065.                 If Len(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0 Then
  1066.                     Tsxx = GridStr(Jsqte, 2)
  1067.                     Lrywlz = Jsqte
  1068.                     GoTo Lrcwcl
  1069.                     Exit For
  1070.                 End If
  1071.             End If
  1072.             
  1073.             '字段不能为零
  1074.             If GridInt(Jsqte, 5) = 2 Then
  1075.                 If Val(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0 Then
  1076.                     Tsxx = GridStr(Jsqte, 2)
  1077.                     Lrywlz = Jsqte
  1078.                     GoTo Lrcwcl
  1079.                     Exit For
  1080.                 End If
  1081.             End If
  1082.             
  1083.         Next Jsqte
  1084.         
  1085.         
  1086.         '1.2进行其他有效性判断,编写格式同1.1
  1087.         '首先进行为空判断(固定不变)
  1088.         For Jsqte = Qslz To .Cols - 1
  1089.             If (GridInt(Jsqte, 5) = 1 And Len(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0) Or (GridInt(Jsqte, 5) = 2 And Val(Trim(.TextMatrix(Yxxpdh, Jsqte))) = 0) Then
  1090.                 Tsxx = GridStr(Jsqte, 2)
  1091.                 Lrywlz = Jsqte
  1092.                 GoTo Lrcwcl
  1093.                 Exit For
  1094.             End If
  1095.         Next Jsqte
  1096.         
  1097.         '2.[自定义判断(补丁)
  1098.         If Val(Trim(.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)))) = 0 And Val(Trim(.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)))) = 0 Then
  1099.             Tsxx = "借方和贷方金额不能同时为零!"
  1100.             Lrywlz = Sydz("004", GridStr(), Szzls)
  1101.             GoTo Lrcwcl
  1102.         End If
  1103.         
  1104.         If Val(Trim(.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)))) <> 0 And Val(Trim(.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)))) <> 0 Then
  1105.             Tsxx = "借方和贷方金额不能同时不为零!"
  1106.             Lrywlz = Sydz("004", GridStr(), Szzls)
  1107.             GoTo Lrcwcl
  1108.         End If
  1109.         '判断日期
  1110.         If Trim(.TextMatrix(Yxxpdh, Sydz("001", GridStr(), Szzls))) = "" Then
  1111.             Tsxx = "必须输入日期!"
  1112.             Lrywlz = Sydz("001", GridStr(), Szzls)
  1113.             GoTo Lrcwcl
  1114.         End If
  1115.         
  1116.         If Val(Trim(.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)))) <> 0 And Val(Trim(.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)))) = 0 Then
  1117.             Lrywlz = Sydz("004", GridStr(), Szzls)
  1118.             Call Sjhj
  1119.         End If
  1120.         If Val(Trim(.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)))) = 0 And Val(Trim(.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)))) <> 0 Then
  1121.             Lrywlz = Sydz("004", GridStr(), Szzls)
  1122.             Call Sjhj
  1123.         End If
  1124.         '以上为自定义部分]
  1125.         
  1126.         '2.放置行处理程序(当数据行通过有效性判断)
  1127.         
  1128.         On Error GoTo Swcwcl
  1129.         
  1130.         Cw_DataEnvi.DataConnect.BeginTrans
  1131.         If WglrGrid.TextMatrix(Yxxpdh, 1) = "" Then
  1132.             If RecTemp.State = 1 Then RecTemp.Close
  1133.             RecTemp.Open "Select * From Cwzz_bankbill", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1134.             With RecTemp
  1135.                 '新增银行对帐单
  1136.                 .AddNew
  1137.                 .Fields("RecType") = 2                                                                                  '记录类型
  1138.                 .Fields("ccode") = Val(Lab_kjbm)                                                                        '会计年度
  1139.                 .Fields("billdate") = Format(WglrGrid.TextMatrix(Yxxpdh, Sydz("001", GridStr(), Szzls)), "yyyy-mm-dd")  '票据日期
  1140.                 .Fields("billno") = WglrGrid.TextMatrix(Yxxpdh, Sydz("003", GridStr(), Szzls))                          '凭证号
  1141.                 Sqlstr = "select * from GY_settlement where ssname='" & WglrGrid.TextMatrix(Yxxpdh, Sydz("002", GridStr(), Szzls)) & "'"
  1142.                 Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1143.                 If Cxnrrec.EOF = False Then
  1144.                     .Fields("sscode") = Trim(Cxnrrec.Fields!sscode)                                                     '结算方式
  1145.                 End If
  1146.                 .Fields("bcheckflag") = 0                                                                               '勾对标志
  1147.                 .Fields("bdelete") = 0                                                                                  '核销标志
  1148.                 .Fields("Jfje") = Val(Format(WglrGrid.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)), "0.00"))       '借方金额
  1149.                 .Fields("Dfje") = Val(Format(WglrGrid.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)), "0.00"))       '贷方金额
  1150.                 .Fields("Digest") = WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls))                          '描述
  1151.                 .Update
  1152.                 WglrGrid.TextMatrix(Yxxpdh, 1) = .Fields("BankBillID")                                                        '显示I_ID号
  1153.             End With
  1154.         Else
  1155.             '修改银行对帐单
  1156.             If RecTemp.State = 1 Then RecTemp.Close
  1157.             RecTemp.Open "Select * From Cwzz_bankbill WHERE CCODE='" & Val(Lab_kjbm) & "' AND BankBillID='" & WglrGrid.TextMatrix(Yxxpdh, 1) & "'AND RECTYPE=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1158.             With RecTemp
  1159.                 .Fields("RecType") = 2                                                                                  '记录类型
  1160.                 .Fields("ccode") = Val(Lab_kjbm)                                                                        '会计年度
  1161.                 .Fields("billdate") = Format(WglrGrid.TextMatrix(Yxxpdh, Sydz("001", GridStr(), Szzls)), "yyyy-mm-dd")  '票据日期
  1162.                 .Fields("billno") = WglrGrid.TextMatrix(Yxxpdh, Sydz("003", GridStr(), Szzls))                          '凭证号
  1163.                 Sqlstr = "select * from GY_settlement where  " _
  1164.                 & "ssname='" & WglrGrid.TextMatrix(Yxxpdh, Sydz("002", GridStr(), Szzls)) & "'"
  1165.                 Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1166.                 If Cxnrrec.EOF = False Then
  1167.                     .Fields("sscode") = Trim(Cxnrrec.Fields!sscode)                                                     '结算方式
  1168.                 End If
  1169.                 .Fields("bdelete") = 0                                                                                  '核销标志
  1170.                 .Fields("Jfje") = Val(Format(WglrGrid.TextMatrix(Yxxpdh, Sydz("004", GridStr(), Szzls)), "0.00"))       '借方金额
  1171.                 .Fields("Dfje") = Val(Format(WglrGrid.TextMatrix(Yxxpdh, Sydz("005", GridStr(), Szzls)), "0.00"))       '贷方金额
  1172.                 .Fields("Digest") = WglrGrid.TextMatrix(Yxxpdh, Sydz("007", GridStr(), Szzls))                          '描述
  1173.                 .Update
  1174.             End With
  1175.         End If
  1176.         Cw_DataEnvi.DataConnect.CommitTrans
  1177.         
  1178.     End With
  1179.     
  1180.     '以上为自定义部分]
  1181.     
  1182.     Sjhzyxxpd = True
  1183.     Hyxxpdlock = True
  1184.     Exit Function
  1185.     
  1186. Swcwcl:
  1187.     
  1188.     Cw_DataEnvi.DataConnect.RollbackTrans
  1189.     Tsxx = "存盘过程中出现未知错误,程序自动恢复保存前状态!"
  1190.     Call Xtxxts(Tsxx, 0, 1)
  1191.     Exit Function
  1192.     
  1193. Lrcwcl:      '录入错误处理
  1194.     
  1195.     With WglrGrid
  1196.         Call Xtxxts(Tsxx, 0, 1)
  1197.         changelock = True
  1198.         .Select Yxxpdh, Lrywlz
  1199.         changelock = False
  1200.         Call xswbk
  1201.         
  1202.         Sjhzyxxpd = False
  1203.         Exit Function
  1204.     End With
  1205.     
  1206. End Function
  1207. '===================以 下 程 序 为 通 用 部 分 ,一 般 不 需 更 改(程序动作部分)======================='
  1208. Private Sub Sub_AdjustGrid()
  1209.     
  1210.     '调 整 网 格
  1211.     With WglrGrid
  1212.         '加 1 保持一行录入行
  1213.         If .Rows < Pmbcsjhs + .FixedRows + Fzxwghs + 1 Then
  1214.             .Rows = Pmbcsjhs + .FixedRows + Fzxwghs + 1
  1215.             For Jsqte = .FixedRows To .Rows - 1
  1216.                 .RowHeight(Jsqte) = Sjhgd
  1217.             Next Jsqte
  1218.         Else
  1219.             '判断是否有辅助行和录入行,如没有则加行
  1220.             Do While .TextMatrix(.Rows - 1 - Fzxwghs, 0) = "*"
  1221.                 .AddItem ""
  1222.                 .RowHeight(.Rows - 1) = Sjhgd
  1223.             Loop
  1224.         End If
  1225.     End With
  1226.     
  1227. End Sub
  1228. Private Sub Lrzdbz()                                                      '录入字段帮助
  1229.     
  1230.     If Not Ydcommand.Visible Then
  1231.         Exit Sub
  1232.     End If
  1233.     
  1234.     With WglrGrid
  1235.         
  1236.         Valilock = True
  1237.         
  1238.         '处理通用部分
  1239.         changelock = True        '调入另外窗体必须加锁
  1240.         Call Drbmhelp(GridInt(.Col, 6), GridStr(.Col, 3), Trim(Ydtext.Text))
  1241.         changelock = False
  1242.         
  1243.         If Len(Xtfhcs) <> 0 Then
  1244.             If GridInt(.Col, 7) = 0 Then
  1245.                 Ydtext.Text = Xtfhcs
  1246.             Else
  1247.                 Ydtext.Text = Xtfhcsfz
  1248.             End If
  1249.         End If
  1250.         
  1251.         Valilock = False
  1252.         
  1253.         If Ydtext.Visible Then
  1254.             Ydtext.SetFocus
  1255.         End If
  1256.         
  1257.     End With
  1258.     
  1259. End Sub
  1260. Private Sub Form_Resize()                                                '窗体大小发生变化时,重新显示文本框
  1261.     
  1262.     On Error Resume Next
  1263.     With WglrGrid
  1264.         .Width = Me.Width - 160
  1265.         .Height = Me.Height - .Top - 400
  1266.     End With
  1267.     With Pic_Title
  1268.         .Width = Me.Width - 160
  1269.     End With
  1270.     
  1271.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  1272.     
  1273.     Call Cxxswbk
  1274.     
  1275. End Sub
  1276. Private Function Fun_Drfrmyxxpd() As Boolean                             '调入其它窗体或功能产生的有效性判断(包括数据回写)
  1277.     
  1278.     Fun_Drfrmyxxpd = True
  1279.     
  1280.     With WglrGrid
  1281.         '如果当前网格处于编辑状态,则先进行数据回写再进行有效性判断
  1282.         
  1283.         If Ydtext.Visible Or YdCombo.Visible Then
  1284.             Call Lrsjhx
  1285.             If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
  1286.                 Fun_Drfrmyxxpd = False
  1287.                 Exit Function
  1288.             End If
  1289.         End If
  1290.         
  1291.         '进行行有效性判断
  1292.         If Not Sjhzyxxpd(.Row) Then
  1293.             Fun_Drfrmyxxpd = False
  1294.             Exit Function
  1295.         End If
  1296.     End With
  1297.     
  1298. End Function
  1299. Private Sub WglrGrid_EnterCell()                                                 '显示当前数据行相关信息
  1300.     
  1301.     With WglrGrid
  1302.         If .Row >= .FixedRows Then
  1303.             Lab_Row = Trim(Str(.Row - .FixedRows + 1))
  1304.         End If
  1305.     End With
  1306.     
  1307. End Sub
  1308. Private Sub WglrGrid_GotFocus()                                     '网格得到焦点
  1309.     
  1310.     '网格得到焦点,如果当前选择行为非数据行
  1311.     '则调整当前焦点至有效数据行
  1312.     
  1313.     With WglrGrid
  1314.         If .Row < .FixedRows And .Rows > .FixedRows Then
  1315.             changelock = True
  1316.             .Select .FixedRows, .Col
  1317.             changelock = False
  1318.         End If
  1319.         If .Col < Qslz Then
  1320.             changelock = True
  1321.             .Select .Row, Qslz
  1322.             changelock = False
  1323.         End If
  1324.     End With
  1325.     
  1326. End Sub
  1327. Private Sub WglrGrid_LostFocus()                                    '录入网格失去焦点
  1328.     
  1329.     '用以屏蔽调用其它窗体时发生网格失去焦点事件
  1330.     If changelock Then
  1331.         Exit Sub
  1332.     End If
  1333.     
  1334.     '引发网格RowcolChange事件
  1335.     With WglrGrid
  1336.         If Not (Ydtext.Visible Or YdCombo.Visible) Then
  1337.             .Select 0, 0
  1338.         End If
  1339.     End With
  1340.     
  1341. End Sub
  1342. Private Sub WglrGrid_AfterScroll(ByVal OldTopRow As Long, ByVal OldLeftCol As Long, ByVal NewTopRow As Long, ByVal NewLeftCol As Long)                                       '限制用户在录入过程中滚动鼠标
  1343.     
  1344.     If Gdtlock Then
  1345.         Exit Sub
  1346.     End If
  1347.     
  1348.     With WglrGrid
  1349.         If Ydtext.Visible Or YdCombo.Visible Then
  1350.             Gdtlock = True
  1351.             .TopRow = Dqtoprow
  1352.             .LeftCol = Dqleftcol
  1353.             Gdtlock = False
  1354.             Exit Sub
  1355.         End If
  1356.     End With
  1357.     
  1358. End Sub
  1359. Private Sub WglrGrid_LeaveCell()                                    '离开单元格
  1360.     
  1361.     If changelock Then
  1362.         Exit Sub
  1363.     End If
  1364.     
  1365.     '记录刚刚离开网格单元的行列值
  1366.     Dqlkwgh = WglrGrid.Row
  1367.     Dqlkwgl = WglrGrid.Col
  1368.     
  1369.     '判断是否需要录入数据回写
  1370.     If Not (Ydtext.Visible Or YdCombo.Visible) Then
  1371.         Exit Sub
  1372.     End If
  1373.     
  1374.     Call Lrsjhx
  1375.     
  1376. End Sub
  1377. Private Sub WglrGrid_RowColChange()                                '网格录入行列发生变化时,进行有效性判断
  1378.     
  1379.     Valilock = True       '屏蔽文本框失去焦点进行有效性判断
  1380.     
  1381.     With WglrGrid
  1382.         If changelock Then
  1383.             Exit Sub
  1384.         End If
  1385.         If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
  1386.             Exit Sub
  1387.         End If
  1388.         If .Row <> Dqlkwgh Then
  1389.             If Not Sjhzyxxpd(Dqlkwgh) Then
  1390.                 Exit Sub
  1391.             End If
  1392.         End If
  1393.     End With
  1394.     
  1395.     Call fhyxh
  1396.     Call Xldql
  1397.     
  1398. End Sub
  1399. Private Sub WglrGrid_DblClick()          '鼠标双击网格显示文本框
  1400.     
  1401.     With WglrGrid
  1402.         Call xswbk
  1403.     End With
  1404.     
  1405. End Sub
  1406. Private Sub Ycwbk()                      '隐藏文本框,帮助按钮,列表组合框
  1407.     
  1408.     Valilock = True
  1409.     Ydtext.Visible = False
  1410.     YdCombo.Visible = False
  1411.     Ydcommand.Visible = False
  1412.     
  1413. End Sub
  1414. Private Sub YdCombo_KeyDown(KeyCode As Integer, Shift As Integer)        '列表框移动
  1415.     With WglrGrid
  1416.         Select Case KeyCode
  1417.         Case vbKeyEscape                'ESC 键放弃录入
  1418.             Valilock = True
  1419.             .SetFocus
  1420.             Call Ycwbk
  1421.             Valilock = False
  1422.         Case vbKeyReturn                '回 车 键 =13
  1423.             KeyCode = 0
  1424.             .SetFocus
  1425.             Call Lrsjhx
  1426.             Rowjsq = .Row
  1427.             Coljsq = .Col + 1
  1428.             If Coljsq > .Cols - 1 Then
  1429.                 If Rowjsq < .Rows - 1 Then
  1430.                     Rowjsq = Rowjsq + 1
  1431.                 End If
  1432.                 Coljsq = Qslz
  1433.             End If
  1434.             Do While Rowjsq <= .Rows - 1
  1435.                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1436.                     Coljsq = Coljsq + 1
  1437.                     If Coljsq > .Cols - 1 Then
  1438.                         Rowjsq = Rowjsq + 1
  1439.                         Coljsq = Qslz
  1440.                     End If
  1441.                 Else
  1442.                     Exit Do
  1443.                 End If
  1444.             Loop
  1445.             .Select Rowjsq, Coljsq
  1446.             
  1447.         Case vbKeyLeft                  '左 箭 头 =37
  1448.             If .Col - 1 = Qslz Then
  1449.                 If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1450.                     GoTo jzzx
  1451.                 End If
  1452.             End If
  1453.             If .Col > Qslz Then
  1454.                 KeyCode = 0
  1455.                 .SetFocus
  1456.                 Call Lrsjhx
  1457.                 Coljsq = .Col - 1
  1458.                 Do While Coljsq > Qslz
  1459.                     If Coljsq - 1 = Qslz Then
  1460.                         If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1461.                             GoTo jzzx
  1462.                         End If
  1463.                     End If
  1464.                     If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1465.                         Coljsq = Coljsq - 1
  1466.                     Else
  1467.                         Exit Do
  1468.                     End If
  1469.                 Loop
  1470.                 .Select .Row, Coljsq
  1471.             End If
  1472.             
  1473.         Case vbKeyRight                 '右 箭 头 =39
  1474.             KeyCode = 0
  1475.             .SetFocus
  1476.             Call Lrsjhx
  1477.             Rowjsq = .Row
  1478.             Coljsq = .Col + 1
  1479.             If Coljsq > .Cols - 1 Then
  1480.                 If Rowjsq < .Rows - 1 Then
  1481.                     Rowjsq = Rowjsq + 1
  1482.                 End If
  1483.                 Coljsq = Qslz
  1484.             End If
  1485.             Do While Rowjsq <= .Rows - 1
  1486.                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1487.                     Coljsq = Coljsq + 1
  1488.                     If Coljsq > .Cols - 1 Then
  1489.                         Rowjsq = Rowjsq + 1
  1490.                         Coljsq = Qslz
  1491.                     End If
  1492.                 Else
  1493.                     Exit Do
  1494.                 End If
  1495.             Loop
  1496.             .Select Rowjsq, Coljsq
  1497.         Case Else
  1498.             
  1499.         End Select
  1500.         
  1501. jzzx:
  1502.         
  1503.     End With
  1504.     
  1505. End Sub
  1506. Private Sub YdCombo_LostFocus()
  1507.     
  1508.     With WglrGrid                                    '因为选中网格会先发生Rowcolchange事件置Valiock
  1509.         If Not Valilock Then                           '为TRUE
  1510.             Call Lrsjhx
  1511.             If Not Sjhzyxxpd(Dqlrwgh) Then
  1512.                 Exit Sub
  1513.             End If
  1514.         End If
  1515.     End With
  1516. End Sub
  1517. Private Sub Ydcommand_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  1518.     
  1519.     Call Lrzdbz
  1520.     
  1521. End Sub
  1522. Private Sub ydtext_KeyDown(KeyCode As Integer, Shift As Integer)
  1523.     
  1524.     Dim Rowjsq As Long, Coljsq As Long
  1525.     
  1526.     With WglrGrid
  1527.         Select Case KeyCode
  1528.         Case vbKeyF2
  1529.             Call Lrzdbz
  1530.         Case vbKeyEscape                'ESC 键放弃录入
  1531.             Valilock = True
  1532.             Call Ycwbk
  1533.             .SetFocus
  1534.         Case vbKeyReturn                '回 车 键 =13
  1535.             KeyCode = 0
  1536.             .SetFocus
  1537.             Call Lrsjhx
  1538.             Rowjsq = .Row
  1539.             Coljsq = .Col + 1
  1540.             If Coljsq > .Cols - 1 Then
  1541.                 If Rowjsq < .Rows - 1 Then
  1542.                     Rowjsq = Rowjsq + 1
  1543.                 End If
  1544.                 Coljsq = Qslz
  1545.             End If
  1546.             Do While Rowjsq <= .Rows - 1
  1547.                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1548.                     Coljsq = Coljsq + 1
  1549.                     If Coljsq > .Cols - 1 Then
  1550.                         Rowjsq = Rowjsq + 1
  1551.                         Coljsq = Qslz
  1552.                     End If
  1553.                 Else
  1554.                     Exit Do
  1555.                 End If
  1556.             Loop
  1557.             If Rowjsq <= .Rows - 1 Then
  1558.                 .Select Rowjsq, Coljsq
  1559.             End If
  1560.             
  1561.         Case vbKeyUp                    '上 箭 头 =38
  1562.             KeyCode = 0
  1563.             .SetFocus
  1564.             Call Lrsjhx
  1565.             If .Row > .FixedRows Then
  1566.                 .Row = .Row - 1
  1567.             End If
  1568.             
  1569.         Case vbKeyDown                  '下 箭 头 =40
  1570.             KeyCode = 0
  1571.             .SetFocus
  1572.             Call Lrsjhx
  1573.             If .Row < .Rows - 1 Then
  1574.                 .Row = .Row + 1
  1575.             End If
  1576.             
  1577.         Case vbKeyLeft                  '左 箭 头 =37
  1578.             If .Col - 1 = Qslz Then
  1579.                 If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1580.                     GoTo jzzx
  1581.                 End If
  1582.             End If
  1583.             If Ydtext.SelStart = 0 And .Col > Qslz Then
  1584.                 KeyCode = 0
  1585.                 .SetFocus
  1586.                 Call Lrsjhx
  1587.                 Coljsq = .Col - 1
  1588.                 Do While Coljsq > Qslz
  1589.                     If Coljsq - 1 = Qslz Then
  1590.                         If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1591.                             GoTo jzzx
  1592.                         End If
  1593.                     End If
  1594.                     If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1595.                         Coljsq = Coljsq - 1
  1596.                     Else
  1597.                         Exit Do
  1598.                     End If
  1599.                 Loop
  1600.                 .Select .Row, Coljsq
  1601.             End If
  1602. jzzx:
  1603.             
  1604.         Case vbKeyRight                 '右 箭 头 =39
  1605.             wblong = Len(Ydtext.Text)
  1606.             If (Ydtext.SelStart = wblong Or Ydtext.SelLength = wblong) Then
  1607.                 KeyCode = 0
  1608.                 .SetFocus
  1609.                 Call Lrsjhx
  1610.                 Rowjsq = .Row
  1611.                 Coljsq = .Col + 1
  1612.                 If Coljsq > .Cols - 1 Then
  1613.                     If Rowjsq < .Rows - 1 Then
  1614.                         Rowjsq = Rowjsq + 1
  1615.                     End If
  1616.                     Coljsq = Qslz
  1617.                 End If
  1618.                 Do While Rowjsq <= .Rows - 1
  1619.                     If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1620.                         Coljsq = Coljsq + 1
  1621.                         If Coljsq > .Cols - 1 Then
  1622.                             Rowjsq = Rowjsq + 1
  1623.                             Coljsq = Qslz
  1624.                         End If
  1625.                     Else
  1626.                         Exit Do
  1627.                     End If
  1628.                 Loop
  1629.                 .Select Rowjsq, Coljsq
  1630.             End If
  1631.         Case Else
  1632.             
  1633.         End Select
  1634.     End With
  1635.     
  1636. End Sub
  1637. Private Sub ydtext_KeyPress(KeyAscii As Integer)         '录入字符事中控制
  1638.     
  1639.     Call InputFieldLimit(Ydtext, GridInt(WglrGrid.Col, 1), KeyAscii)
  1640.     
  1641.     If KeyAscii <> 0 Then
  1642.         Call Xyxhbz(Dqlrwgh)
  1643.     End If
  1644.     
  1645. End Sub
  1646. Private Sub ydtext_Change()                              '录入事中变化处理
  1647.     
  1648.     '防止程序改变但不进行处理
  1649.     
  1650.     If Wbkbhlock Then
  1651.         Exit Sub
  1652.     End If
  1653.     
  1654.     With WglrGrid
  1655.         
  1656.         '限制字段录入长度
  1657.         Wbkbhlock = True
  1658.         Select Case GridInt(.Col, 1)
  1659.         Case 8, 11   '金额型
  1660.             Call Sjgskz(Ydtext, Xtjezws - Xtjexsws - 1, Xtjexsws)
  1661.         Case 9, 12   '数量型
  1662.             Call Sjgskz(Ydtext, Xtslzws - Xtslxsws - 1, Xtslxsws)
  1663.         Case 10      '单价型
  1664.             Call Sjgskz(Ydtext, Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1665.         Case Else    '其他类型
  1666.             If GridInt(.Col, 3) <> 0 Or GridInt(.Col, 4) <> 0 Then
  1667.                 Call Sjgskz(Ydtext, GridInt(.Col, 3), GridInt(.Col, 4))
  1668.             End If
  1669.         End Select
  1670.         Wbkbhlock = False
  1671.     End With
  1672.     
  1673. End Sub
  1674. Private Sub ydtext_LostFocus()            '如果由于选中网格之外的控件而发生有效性判断(选中网格会先发生Rowcolchange事件置Valiock为TRUE)
  1675.     
  1676.     With WglrGrid
  1677.         If Not Valilock Then
  1678.             Call Lrsjhx
  1679.             If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
  1680.                 Exit Sub
  1681.             End If
  1682.             If Not Sjhzyxxpd(Dqlrwgh) Then
  1683.                 Exit Sub
  1684.             End If
  1685.         End If
  1686.     End With
  1687.     
  1688. End Sub
  1689. Private Sub xswbk()                       '在当前选中单元显示文本框,列表框,帮助按钮(通用)
  1690.     
  1691.     Dim Wbkpy As Integer, Wbkpy1 As Integer '文本框偏移量
  1692.     '当某种条件成立时禁止文本框激活使单据处于录入状态
  1693.     If Not Fun_AllowInput Then
  1694.         Exit Sub
  1695.     End If
  1696.     
  1697.     '显示文本框前返回有效行列(解决滚动条问题)
  1698.     Call Xldqh
  1699.     Call Xldql
  1700.     
  1701.     '隐藏文本框,帮助按钮,列表组合框
  1702.     Call Ycwbk
  1703.     
  1704.     With WglrGrid
  1705.         Dqlrwgh = .Row
  1706.         Dqlrwgl = .Col
  1707.         If Not GridBoolean(.Col, 1) Or .Row < .FixedRows Then
  1708.             Exit Sub
  1709.         End If
  1710.         
  1711.         Wbkpy = 30
  1712.         Wbkpy1 = 15
  1713.         
  1714.         If GridBoolean(.Col, 3) Then
  1715.             YdCombo.Left = .CellLeft + .Left + Wbkpy
  1716.             YdCombo.Top = .CellTop + .Top + Wbkpy
  1717.             YdCombo.Width = .CellWidth - Wbkpy1
  1718.             Call Wbkcl
  1719.             YdCombo.Visible = True
  1720.             YdCombo.SetFocus
  1721.             Ydcommand.Visible = False
  1722.             Ydtext.Visible = False
  1723.         Else
  1724.             If GridBoolean(.Col, 2) Then
  1725.                 Ydcommand.Left = .Left + .CellLeft + .CellWidth - Ydcommand.Width + Wbkpy
  1726.                 Ydcommand.Top = .Top + .CellTop + .CellHeight - Ydcommand.Height + Wbkpy
  1727.                 Ydcommand.Visible = True
  1728.             Else
  1729.                 Ydcommand.Visible = False
  1730.             End If
  1731.             
  1732.             Ydtext.Left = .CellLeft + .Left + Wbkpy
  1733.             Ydtext.Top = .CellTop + .Top + Wbkpy
  1734.             
  1735.             If Ydcommand.Visible Then
  1736.                 If Sfblbzkd Then
  1737.                     Ydtext.Width = .CellWidth - Ydcommand.Width
  1738.                 Else
  1739.                     Ydtext.Width = .CellWidth - Wbkpy1
  1740.                 End If
  1741.             Else
  1742.                 Ydtext.Width = .CellWidth - Wbkpy1
  1743.             End If
  1744.             
  1745.             Ydtext.Height = .CellHeight - Wbkpy1
  1746.             
  1747.             If GridInt(.Col, 2) <> 0 Then
  1748.                 Ydtext.MaxLength = GridInt(.Col, 2)
  1749.             Else
  1750.                 Ydtext.MaxLength = 3000
  1751.             End If
  1752.             
  1753.             Call Wbkcl
  1754.             
  1755.             Ydtext.Visible = True
  1756.             Ydtext.SetFocus
  1757.         End If
  1758.         
  1759.         Dqtoprow = .TopRow
  1760.         Dqleftcol = .LeftCol
  1761.         
  1762.         '重置锁值
  1763.         Valilock = False
  1764.         Wbkbhlock = False
  1765.         
  1766.     End With
  1767.     
  1768. End Sub
  1769. Private Function Fun_AllowInput() As Boolean                           '当某种条件成立时禁止文本框激活使单据处于录入状态
  1770.     
  1771.     '如果单据操作状态为浏览状态则不能显示录入载体(通用)
  1772.     If Trim(Lab_OperStatus.Caption) = "1" Then
  1773.         Exit Function
  1774.     End If
  1775.     
  1776.     '[>>
  1777.     
  1778.     '颜色为Label3(0).BackColor的记录不能被修改
  1779.     If WglrGrid.Cell(flexcpBackColor, WglrGrid.Row) = Label3(0).BackColor Then
  1780.         Exit Function
  1781.     End If
  1782.     
  1783.     '此处可以填写禁止文本框激活使单据处于录入状态的理由
  1784.     
  1785.     '<<]
  1786.     
  1787.     Fun_AllowInput = True
  1788.     
  1789. End Function
  1790. Private Sub Cxxswbk()                                                  'Formresize中重新显示文本框,列表框,帮助按钮(通用)
  1791.     
  1792.     Dim Wbkpy As Integer, Wbkpy1 As Integer
  1793.     
  1794.     Wbkpy = 30
  1795.     Wbkpy1 = 15
  1796.     
  1797.     With WglrGrid
  1798.         If YdCombo.Visible Then
  1799.             YdCombo.Left = .CellLeft + .Left + Wbkpy
  1800.             YdCombo.Top = .CellTop + .Top + Wbkpy
  1801.             YdCombo.Width = .CellWidth - Wbkpy1
  1802.         End If
  1803.         If Ydcommand.Visible Then
  1804.             Ydcommand.Left = .Left + .CellLeft + .CellWidth - Ydcommand.Width + Wbkpy
  1805.             Ydcommand.Top = .Top + .CellTop + .CellHeight - Ydcommand.Height + Wbkpy
  1806.         End If
  1807.         If Ydtext.Visible Then
  1808.             If Ydcommand.Visible Then
  1809.                 If Sfblbzkd Then
  1810.                     Ydtext.Width = .CellWidth - Ydcommand.Width
  1811.                 Else
  1812.                     Ydtext.Width = .CellWidth - Wbkpy1
  1813.                 End If
  1814.             Else
  1815.                 Ydtext.Width = .CellWidth - Wbkpy1
  1816.             End If
  1817.             
  1818.             Ydtext.Left = .CellLeft + .Left + Wbkpy
  1819.             Ydtext.Top = .CellTop + .Top + Wbkpy
  1820.             Ydtext.Height = .CellHeight - Wbkpy1
  1821.         End If
  1822.     End With
  1823.     
  1824. End Sub
  1825. Private Sub Lrsjhx()                                                   '文本框录入数据回写
  1826.     
  1827.     With WglrGrid
  1828.         If YdCombo.Visible Then
  1829.             .Text = Trim(YdCombo.Text)
  1830.         End If
  1831.         If Ydtext.Visible Then
  1832.             .Text = Trim(Ydtext.Text)
  1833.         End If
  1834.         
  1835.         '(如果字段录入内容发生变化,则打开有效性判断锁)
  1836.         If Zdlrqnr <> Trim(.Text) Then
  1837.             Yxxpdlock = False
  1838.             Hyxxpdlock = False
  1839.         End If
  1840.         
  1841.         '如果字段录入内容不为空则写数据行有效性标志
  1842.         
  1843.         If Len(Trim(.Text)) <> 0 Then
  1844.             Call Xyxhbz(.Row)
  1845.         End If
  1846.         
  1847.         '隐藏文本框,帮助按钮,列表组合框
  1848.         Call Ycwbk
  1849.     End With
  1850.     
  1851. End Sub
  1852. Private Sub WglrGrid_KeyDown(KeyCode As Integer, Shift As Integer)    '网格录入增行,删行快捷键
  1853.     
  1854.     '如果单据操作状态为浏览状态则不能显示录入载体
  1855.     If Trim(Lab_OperStatus.Caption) = "1" Then
  1856.         Exit Sub
  1857.     End If
  1858.     
  1859.     Select Case KeyCode
  1860.     Case vbKeyF2                   '按F2键参照
  1861.         Call xswbk
  1862.         Call Lrzdbz
  1863.     Case vbKeyDelete               '删行
  1864.         Call Scdqfl
  1865.     Case vbKeyInsert               '增行
  1866.         Call zjlrfl
  1867.     End Select
  1868.     
  1869. End Sub
  1870. Private Sub WglrGrid_KeyPress(KeyAscii As Integer)                             '网格接受键盘录入
  1871.     
  1872.     '当某种条件成立时禁止文本框激活使单据处于录入状态
  1873.     If Not Fun_AllowInput Then
  1874.         Exit Sub
  1875.     End If
  1876.     
  1877.     With WglrGrid
  1878.         
  1879.         '屏 蔽 回 车 键
  1880.         If KeyAscii = vbKeyReturn Then
  1881.             KeyAscii = 0
  1882.             Rowjsq = .Row
  1883.             Coljsq = .Col + 1
  1884.             If Coljsq > .Cols - 1 Then
  1885.                 If Rowjsq < .Rows - 1 Then
  1886.                     Rowjsq = Rowjsq + 1
  1887.                 End If
  1888.                 Coljsq = Qslz
  1889.             End If
  1890.             Do While Rowjsq <= .Rows - 1
  1891.                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1892.                     Coljsq = Coljsq + 1
  1893.                     If Coljsq > .Cols - 1 Then
  1894.                         Rowjsq = Rowjsq + 1
  1895.                         Coljsq = Qslz
  1896.                     End If
  1897.                 Else
  1898.                     Exit Do
  1899.                 End If
  1900.             Loop
  1901.             
  1902.             If Rowjsq <= .Rows - 1 Then
  1903.                 .Select Rowjsq, Coljsq
  1904.             End If
  1905.             
  1906.             Exit Sub
  1907.         End If
  1908.         
  1909.         '接受用户录入
  1910.         Select Case KeyAscii
  1911.         Case 0 To 32             '用户输入KeyAscii为0-32的键 如空格
  1912.             
  1913.             '显示录入载体
  1914.             Call xswbk
  1915.             
  1916.         Case Else
  1917.             
  1918.             '防止非编辑字段SendKeys()出现死循环
  1919.             If Not GridBoolean(.Col, 1) Or .Row < .FixedRows Then
  1920.                 Exit Sub
  1921.             End If
  1922.             
  1923.             '如果此字段为列表框录入则调入相应列表框
  1924.             If GridBoolean(.Col, 3) Then
  1925.                 
  1926.                 '列表框录入
  1927.                 Call xswbk
  1928.             Else
  1929.                 
  1930.                 Ydtext.Text = ""
  1931.                 
  1932.                 '录入限制
  1933.                 Call InputFieldLimit(Ydtext, GridInt(WglrGrid.Col, 1), KeyAscii)
  1934.                 
  1935.                 If KeyAscii = 0 Then
  1936.                     Exit Sub
  1937.                 End If
  1938.                 
  1939.                 '如果录入字符有效则写有效行数据标志
  1940.                 Call Xyxhbz(.Row)
  1941.                 Call xswbk
  1942.                 Ydtext.Text = ""
  1943.                 Valilock = True
  1944.                 SendKeys Chr(KeyAscii), True
  1945.                 DoEvents
  1946.                 Valilock = False
  1947.             End If
  1948.         End Select
  1949.     End With
  1950.     
  1951. End Sub
  1952. Private Sub zjlrfl()                                                    '增加录入分录
  1953.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1954.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1955.         Exit Sub
  1956.     End If
  1957.     
  1958.     With WglrGrid
  1959.         
  1960.         '处于录入状态不能增行
  1961.         If Not (Ydtext.Visible Or YdCombo.Visible) Then
  1962.             If Not Fun_Drfrmyxxpd Then
  1963.                 Exit Sub
  1964.             End If
  1965.         Else
  1966.             Exit Sub
  1967.         End If
  1968.         
  1969.         '处于非数据行和最后一行时不能增行
  1970.         If .Row < .FixedRows Or .Row = .Rows - 1 Then
  1971.             Exit Sub
  1972.         End If
  1973.         
  1974.         .AddItem "", .Row
  1975.         .RowHeight(.Row) = Sjhgd
  1976.         
  1977.         If .Row <> .Rows - 1 Then
  1978.             If .TextMatrix(.Row + 1, 0) = "*" Then
  1979.                 .TextMatrix(.Row, 0) = "*"
  1980.             Else
  1981.                 .RemoveItem .Rows - 1
  1982.             End If
  1983.         End If
  1984.         Call Xldqh
  1985.         Call Xldql
  1986.         Hyxxpdlock = False
  1987.     End With
  1988.     
  1989. End Sub
  1990. Private Sub Scdqfl()                                                    '删除当前分录
  1991.     Dim RecTemp As New ADODB.Recordset
  1992.     
  1993.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1994.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1995.         Exit Sub
  1996.     End If
  1997.     
  1998.     '是否允许删除
  1999.     If WglrGrid.Cell(flexcpBackColor, WglrGrid.Row) = Label3(0).BackColor Then
  2000.         Exit Sub
  2001.     End If
  2002.     With WglrGrid
  2003.         Scqwghz = .Row
  2004.         Scqwglz = .Col
  2005.         If .TextMatrix(.Row, 0) = "*" Then
  2006.             '判断是否为录入状态
  2007.             If Ydtext.Visible Then
  2008.                 Sflrzt = True
  2009.                 Validate = True
  2010.                 Call Lrsjhx
  2011.                 Validate = False
  2012.             End If
  2013.             Call Xldqh
  2014.             changelock = True
  2015.             .Select .Row, 0
  2016.             changelock = False
  2017.             If Shsfts Then
  2018.                 .Cell(flexcpBackColor, .Row, Qslz, .Row, .Cols - 1) = QBColor(12)
  2019.                 Tsxx = "请确认是否删除当前记录?"
  2020.                 Yhanswer = Xtxxts(Tsxx, 2, 2)
  2021.                 If Yhanswer = 2 Then
  2022.                     .Cell(flexcpBackColor, .Row, Qslz, .Row, .Cols - 1) = &H80000005
  2023.                     changelock = True
  2024.                     .Select Scqwghz, Scqwglz
  2025.                     changelock = False
  2026.                     '如为录入状态,则恢复录入
  2027.                     If Sflrzt Then
  2028.                         Call xswbk
  2029.                     End If
  2030.                     Exit Sub
  2031.                 End If
  2032.             End If
  2033.             If RecTemp.State = 1 Then RecTemp.Close
  2034.             RecTemp.Open "select * from cwzz_bankbill where rectype=2 and BankBillID='" & .TextMatrix(.Row, 1) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  2035.             If RecTemp.EOF = False Then
  2036.                 RecTemp.Delete
  2037.             End If
  2038.             .RemoveItem .Row
  2039.             If .Rows < Pmbcsjhs + .FixedRows + Fzxwghs + 1 Then
  2040.                 .AddItem ""
  2041.                 .RowHeight(.Rows - 1) = Sjhgd
  2042.             End If
  2043.             changelock = True
  2044.             .Select .Row, Scqwglz
  2045.             changelock = False
  2046.             '重新计算合计数据
  2047.             Call Sjhj
  2048.         End If
  2049.     End With
  2050.     
  2051.     Exit Sub
  2052.     
  2053.     '[>>事务错误处理
  2054.     
  2055. Swcwcl:
  2056.     
  2057.     Cw_DataEnvi.DataConnect.RollbackTrans
  2058.     
  2059.     Tsxx = "删除过程中出现错误!"
  2060.     Call Xtxxts(Tsxx, 0, 1)
  2061.     Exit Sub
  2062.     '<<]
  2063. End Sub
  2064. Private Sub Qkwlzd(sjh As Long, Sjl As Long)                            '清空为零字段
  2065.     
  2066.     If Not GridBoolean(Sjl, 5) Then
  2067.         Exit Sub
  2068.     End If
  2069.     
  2070.     With WglrGrid
  2071.         If Val(Trim(.TextMatrix(sjh, Sjl))) = 0 Then
  2072.             .TextMatrix(sjh, Sjl) = ""
  2073.         End If
  2074.     End With
  2075.     
  2076. End Sub
  2077. Private Sub fhyxh()                                                     '返回录入数据有效行,同时让得到焦点网格可见
  2078.     
  2079.     With WglrGrid
  2080.         If .Row >= .FixedRows Then
  2081.             If .TextMatrix(.Row, 0) <> "*" Then
  2082.                 For Rowjsq = .FixedRows To .Rows - 1
  2083.                     If .TextMatrix(Rowjsq, 0) <> "*" Then
  2084.                         Exit For
  2085.                     End If
  2086.                 Next Rowjsq
  2087.                 If Rowjsq <= .Rows - 1 Then
  2088.                     changelock = True
  2089.                     .Select Rowjsq, .Col
  2090.                     changelock = False
  2091.                 Else
  2092.                     changelock = True
  2093.                     .Select .Rows - 1, .Col
  2094.                     changelock = False
  2095.                 End If
  2096.             End If
  2097.             Call Xldqh
  2098.         End If
  2099.     End With
  2100.     
  2101. End Sub
  2102. Private Sub Xldqh()                                                      '显露当前行
  2103.     
  2104.     Dim Toprowte As Long
  2105.     
  2106.     With WglrGrid
  2107.         Toprowte = 0
  2108.         
  2109.         Do While .CellTop + .RowHeight(.Row) + Fzxwghs * Sjhgd > .Height And .TopRow <> Toprowte
  2110.             Toprowte = .TopRow
  2111.             .TopRow = .TopRow + 1
  2112.         Loop
  2113.         
  2114.         Toprowte = 0
  2115.         
  2116.         Do While .CellTop < .FixedRows * .RowHeight(0) And .TopRow <> Toprowte
  2117.             Toprowte = .TopRow
  2118.             .TopRow = .TopRow - 1
  2119.         Loop
  2120.     End With
  2121.     
  2122. End Sub
  2123. Private Sub Xldql()                                                     '显露当前列
  2124.     
  2125.     Dim Leftcolte As Long
  2126.     
  2127.     With WglrGrid
  2128.         If .Col >= Qslz And .Col >= .FixedCols Then
  2129.             If .LeftCol > .Col Then
  2130.                 .LeftCol = .Col
  2131.             End If
  2132.             Leftcolte = 0
  2133.             Do While .CellLeft + .CellWidth > .Width And .LeftCol <> Leftcolte
  2134.                 Leftcolte = .LeftCol
  2135.                 .LeftCol = .LeftCol + 1
  2136.             Loop
  2137.         End If
  2138.     End With
  2139.     
  2140. End Sub
  2141. Private Function pdhwk(sjh As Long)                                     '判断网格行是否为空行(所有录入字段均为空*非录入字段除外)
  2142.     
  2143.     With WglrGrid
  2144.         For Coljsq = Qslz To .Cols - 1
  2145.             If Len(Trim(.TextMatrix(sjh, Coljsq))) <> 0 And GridBoolean(Coljsq, 1) Then
  2146.                 pdhwk = False
  2147.                 Exit Function
  2148.             End If
  2149.         Next Coljsq
  2150.         pdhwk = True
  2151.     End With
  2152.     
  2153. End Function
  2154. Private Sub Xyxhbz(sjh As Long)                                         '写行有效性标志,并判断是否增行
  2155.     
  2156.     With WglrGrid
  2157.         If .TextMatrix(sjh, 0) = "*" Then
  2158.             Exit Sub
  2159.         End If
  2160.         .TextMatrix(sjh, 0) = "*"
  2161.         If sjh >= .Rows - Fzxwghs - 1 Then
  2162.             .AddItem ""
  2163.             .RowHeight(.Rows - 1) = Sjhgd
  2164.         End If
  2165.     End With
  2166.     
  2167. End Sub
  2168. Private Sub WglrGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  2169.     
  2170.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  2171.     
  2172. End Sub
  2173. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  2174.     
  2175.     Select Case Button.Key
  2176.     Case "bcgs"                                       '保存表格格式
  2177.         Call Bcwggs(WglrGrid, GridCode, GridStr())
  2178.     Case "hfmrgs"                                     '恢复默认格式
  2179.         Call Hfmrgs(WglrGrid, GridCode, GridStr())
  2180.     End Select
  2181.     
  2182. End Sub
  2183. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  2184.     
  2185.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  2186.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  2187.     
  2188.     '报表小标题行数
  2189.     Bbxbtgs = 1
  2190.     '报表表尾行数
  2191.     Bbbwhgs = 1
  2192.     ReDim Bbxbt(1 To Bbxbtgs)
  2193.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  2194.     If Bbbwhgs <> 0 Then
  2195.         ReDim Bbbwh(1 To Bbbwhgs)
  2196.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  2197.     End If
  2198.     
  2199.     '报表总标题
  2200.     Bbzbt = ReportTitle
  2201.     '报表行组织形式(0-居左 1-居中 2-居右)
  2202.     Bbxbt(1) = Space(0) + Fun_FormatOutPut("会计期间:" + Trim(Label1.Caption), 30)
  2203.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut("科目编码:" + Trim(Lab_kjbm), 26)
  2204.     '报表小标题组织形式
  2205.     '报表行组织形式(0-居左 1-居中 2-居右)
  2206.     bbxbtzzxs(1) = 0
  2207.     Bbbwhzzxs(1) = 1
  2208.     
  2209.     '生成报表数据
  2210.     Call Scyxsjb(WglrGrid)
  2211.     '生成报表
  2212.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  2213.     '卸载预览窗体
  2214.     If Not bbylte Then
  2215.         Unload DY_Tybbyldy
  2216.     End If
  2217.     
  2218. End Sub
  2219. '=====================以下为自定义部分 ======================
  2220. '网格列数据合计
  2221. Private Sub Sjhj()
  2222.     Dim RecTemp As New ADODB.Recordset
  2223.     Dim Hjjg As Double
  2224.     Dim CSData As Currency
  2225.     Dim Rjsq As Integer
  2226.     Sqlstr = "SELECT Sum(Dfje-Jfje) FROM CWZZ_BankBill  Where BankBillID Not In " _
  2227.     & "(Select top " + Text_Num + " BankBillID From Cwzz_BankBill Where Ccode='" & Val(Lab_kjbm) & "' And  BDelete=0  " _
  2228.     & "And RecType=2 Order By BillDate desc) and Ccode='" & Val(Lab_kjbm) & "' And  BDelete=0 And RecType=2"
  2229.     
  2230.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  2231.     If Not IsNull(RecTemp(0)) Then
  2232.         CSData = RecTemp(0)
  2233.     Else
  2234.         CSData = 0
  2235.     End If
  2236.     With WglrGrid
  2237.         For Rjsq = 1 To .Rows - 1
  2238.             Hjjg = 0
  2239.             If Rjsq = 1 Then
  2240.                 Hjjg = Hjjg + Val(Format(.TextMatrix(Rjsq, Sydz("005", GridStr(), Szzls)), "0.00")) - Val(Format(.TextMatrix(Rjsq, Sydz("004", GridStr(), Szzls)), "0.00")) + Val(Format(Label2(0).Caption, "0.00")) + Val(Format(CSData, "0.00"))
  2241.             Else
  2242.                 Hjjg = Hjjg + Val(Format(.TextMatrix(Rjsq, Sydz("005", GridStr(), Szzls)), "0.00")) - Val(Format(.TextMatrix(Rjsq, Sydz("004", GridStr(), Szzls)), "0.00")) + Val(Format(.TextMatrix(Rjsq - 1, Sydz("006", GridStr(), Szzls)), "0.00"))
  2243.             End If
  2244.             If Hjjg <> 0 Then
  2245.                 .TextMatrix(Rjsq, Sydz("006", GridStr(), Szzls)) = Format(Hjjg, "#,###.00")
  2246.             Else
  2247.                 .TextMatrix(Rjsq, Sydz("006", GridStr(), Szzls)) = ""
  2248.             End If
  2249.             If Val(.TextMatrix(Rjsq, Sydz("004", GridStr(), Szzls))) <> 0 Then
  2250.                 .TextMatrix(Rjsq, Sydz("004", GridStr(), Szzls)) = Format(.TextMatrix(Rjsq, Sydz("004", GridStr(), Szzls)), "#,###.00")
  2251.             End If
  2252.             If Val(.TextMatrix(Rjsq, Sydz("005", GridStr(), Szzls))) <> 0 Then
  2253.                 .TextMatrix(Rjsq, Sydz("005", GridStr(), Szzls)) = Format(.TextMatrix(Rjsq, Sydz("005", GridStr(), Szzls)), "#,###.00")
  2254.             End If
  2255.         Next Rjsq
  2256.     End With
  2257. End Sub
  2258. '=====================以上为自定义部分 ======================