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

企业管理

开发平台:

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. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  5. Begin VB.Form Gy_Customer 
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "客户设置"
  8.    ClientHeight    =   7275
  9.    ClientLeft      =   915
  10.    ClientTop       =   1665
  11.    ClientWidth     =   9270
  12.    HelpContextID   =   2001
  13.    Icon            =   "公用_客户设置.frx":0000
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form2"
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    ScaleHeight     =   7275
  19.    ScaleWidth      =   9270
  20.    Begin VB.Timer Timer1 
  21.       Enabled         =   0   'False
  22.       Interval        =   1
  23.       Left            =   2430
  24.       Top             =   585
  25.    End
  26.    Begin TabDlg.SSTab StTab 
  27.       Height          =   6585
  28.       Left            =   30
  29.       TabIndex        =   35
  30.       Top             =   675
  31.       Width           =   9225
  32.       _ExtentX        =   16272
  33.       _ExtentY        =   11615
  34.       _Version        =   393216
  35.       Style           =   1
  36.       Tabs            =   2
  37.       TabHeight       =   520
  38.       TabCaption(0)   =   "列表视图"
  39.       TabPicture(0)   =   "公用_客户设置.frx":08CA
  40.       Tab(0).ControlEnabled=   -1  'True
  41.       Tab(0).Control(0)=   "CzxsGrid"
  42.       Tab(0).Control(0).Enabled=   0   'False
  43.       Tab(0).ControlCount=   1
  44.       TabCaption(1)   =   "单张视图"
  45.       TabPicture(1)   =   "公用_客户设置.frx":08E6
  46.       Tab(1).ControlEnabled=   0   'False
  47.       Tab(1).Control(0)=   "Frame1"
  48.       Tab(1).ControlCount=   1
  49.       Begin VB.Frame Frame1 
  50.          Height          =   6160
  51.          Left            =   -74910
  52.          TabIndex        =   38
  53.          Top             =   343
  54.          Width           =   9045
  55.          Begin VB.CommandButton Ydcommand1 
  56.             Height          =   313
  57.             Index           =   2
  58.             Left            =   3795
  59.             Picture         =   "公用_客户设置.frx":0902
  60.             Style           =   1  'Graphical
  61.             TabIndex        =   73
  62.             Top             =   945
  63.             Width           =   301
  64.          End
  65.          Begin VB.CommandButton Ydcommand1 
  66.             Height          =   313
  67.             Index           =   26
  68.             Left            =   3795
  69.             Picture         =   "公用_客户设置.frx":0C8C
  70.             Style           =   1  'Graphical
  71.             TabIndex        =   72
  72.             Top             =   5370
  73.             Width           =   301
  74.          End
  75.          Begin VB.CommandButton Command4 
  76.             Height          =   300
  77.             Left            =   6150
  78.             Picture         =   "公用_客户设置.frx":1016
  79.             Style           =   1  'Graphical
  80.             TabIndex        =   71
  81.             Top             =   178
  82.             Width           =   300
  83.          End
  84.          Begin VB.CommandButton Command3 
  85.             Height          =   300
  86.             Left            =   5850
  87.             Picture         =   "公用_客户设置.frx":13A0
  88.             Style           =   1  'Graphical
  89.             TabIndex        =   70
  90.             Top             =   178
  91.             Width           =   300
  92.          End
  93.          Begin VB.CommandButton Command2 
  94.             Height          =   300
  95.             Left            =   5550
  96.             Picture         =   "公用_客户设置.frx":172A
  97.             Style           =   1  'Graphical
  98.             TabIndex        =   69
  99.             Top             =   178
  100.             Width           =   300
  101.          End
  102.          Begin VB.CommandButton Command1 
  103.             Height          =   300
  104.             Left            =   5250
  105.             Picture         =   "公用_客户设置.frx":1AB4
  106.             Style           =   1  'Graphical
  107.             TabIndex        =   68
  108.             Top             =   178
  109.             Width           =   300
  110.          End
  111.          Begin VB.TextBox LrText 
  112.             Height          =   313
  113.             Index           =   26
  114.             Left            =   1665
  115.             TabIndex        =   26
  116.             Text            =   "0"
  117.             Top             =   5370
  118.             Width           =   2160
  119.          End
  120.          Begin VB.TextBox LrText 
  121.             Height          =   313
  122.             Index           =   17
  123.             Left            =   5640
  124.             TabIndex        =   17
  125.             Text            =   "1"
  126.             Top             =   3555
  127.             Width           =   2160
  128.          End
  129.          Begin VB.TextBox LrText 
  130.             Height          =   313
  131.             Index           =   18
  132.             Left            =   1665
  133.             TabIndex        =   18
  134.             Text            =   "0"
  135.             Top             =   3900
  136.             Width           =   2160
  137.          End
  138.          Begin VB.TextBox LrText 
  139.             Enabled         =   0   'False
  140.             Height          =   313
  141.             Index           =   19
  142.             Left            =   5640
  143.             TabIndex        =   19
  144.             Text            =   "1"
  145.             Top             =   3900
  146.             Width           =   2160
  147.          End
  148.          Begin VB.TextBox LrText 
  149.             Enabled         =   0   'False
  150.             Height          =   313
  151.             Index           =   20
  152.             Left            =   1665
  153.             TabIndex        =   20
  154.             Text            =   "1"
  155.             Top             =   4275
  156.             Width           =   2160
  157.          End
  158.          Begin VB.TextBox LrText 
  159.             Enabled         =   0   'False
  160.             Height          =   313
  161.             Index           =   21
  162.             Left            =   5640
  163.             TabIndex        =   21
  164.             Text            =   "0"
  165.             Top             =   4275
  166.             Width           =   2160
  167.          End
  168.          Begin VB.TextBox LrText 
  169.             Enabled         =   0   'False
  170.             Height          =   313
  171.             Index           =   23
  172.             Left            =   5640
  173.             TabIndex        =   23
  174.             Text            =   "0"
  175.             Top             =   4635
  176.             Width           =   2160
  177.          End
  178.          Begin VB.TextBox LrText 
  179.             Enabled         =   0   'False
  180.             Height          =   313
  181.             Index           =   24
  182.             Left            =   1665
  183.             TabIndex        =   24
  184.             Text            =   "1"
  185.             Top             =   5010
  186.             Width           =   2160
  187.          End
  188.          Begin VB.TextBox LrText 
  189.             Height          =   313
  190.             Index           =   16
  191.             Left            =   1665
  192.             TabIndex        =   16
  193.             Text            =   "0"
  194.             Top             =   3555
  195.             Width           =   2160
  196.          End
  197.          Begin VB.TextBox LrText 
  198.             Enabled         =   0   'False
  199.             Height          =   313
  200.             Index           =   22
  201.             Left            =   1665
  202.             TabIndex        =   22
  203.             Text            =   "1"
  204.             Top             =   4635
  205.             Width           =   2160
  206.          End
  207.          Begin VB.TextBox LrText 
  208.             Height          =   313
  209.             Index           =   11
  210.             Left            =   5640
  211.             TabIndex        =   11
  212.             Text            =   "0"
  213.             Top             =   2430
  214.             Width           =   2160
  215.          End
  216.          Begin VB.TextBox LrText 
  217.             Height          =   313
  218.             Index           =   12
  219.             Left            =   1665
  220.             TabIndex        =   12
  221.             Text            =   "1"
  222.             Top             =   2790
  223.             Width           =   2160
  224.          End
  225.          Begin VB.TextBox LrText 
  226.             Height          =   313
  227.             Index           =   13
  228.             Left            =   5640
  229.             TabIndex        =   13
  230.             Text            =   "0"
  231.             Top             =   2790
  232.             Width           =   2160
  233.          End
  234.          Begin VB.TextBox LrText 
  235.             Height          =   313
  236.             Index           =   14
  237.             Left            =   1665
  238.             TabIndex        =   14
  239.             Text            =   "1"
  240.             Top             =   3165
  241.             Width           =   2160
  242.          End
  243.          Begin VB.TextBox LrText 
  244.             Height          =   313
  245.             Index           =   15
  246.             Left            =   5640
  247.             TabIndex        =   15
  248.             Text            =   "1"
  249.             Top             =   3165
  250.             Width           =   2160
  251.          End
  252.          Begin VB.TextBox LrText 
  253.             Height          =   313
  254.             Index           =   5
  255.             Left            =   5640
  256.             TabIndex        =   5
  257.             Text            =   "0"
  258.             Top             =   1320
  259.             Width           =   2160
  260.          End
  261.          Begin VB.TextBox LrText 
  262.             Height          =   313
  263.             Index           =   6
  264.             Left            =   1665
  265.             TabIndex        =   6
  266.             Text            =   "1"
  267.             Top             =   1695
  268.             Width           =   2160
  269.          End
  270.          Begin VB.TextBox LrText 
  271.             Height          =   313
  272.             Index           =   7
  273.             Left            =   5640
  274.             TabIndex        =   7
  275.             Text            =   "0"
  276.             Top             =   1695
  277.             Width           =   2160
  278.          End
  279.          Begin VB.TextBox LrText 
  280.             Height          =   313
  281.             Index           =   8
  282.             Left            =   1665
  283.             TabIndex        =   8
  284.             Text            =   "1"
  285.             Top             =   2055
  286.             Width           =   2160
  287.          End
  288.          Begin VB.TextBox LrText 
  289.             Height          =   313
  290.             Index           =   9
  291.             Left            =   5640
  292.             TabIndex        =   9
  293.             Text            =   "1"
  294.             Top             =   2055
  295.             Width           =   2160
  296.          End
  297.          Begin VB.TextBox LrText 
  298.             Height          =   313
  299.             Index           =   10
  300.             Left            =   1665
  301.             TabIndex        =   10
  302.             Text            =   "1"
  303.             Top             =   2430
  304.             Width           =   2160
  305.          End
  306.          Begin VB.TextBox LrText 
  307.             Height          =   313
  308.             Index           =   0
  309.             Left            =   1665
  310.             TabIndex        =   0
  311.             Text            =   "0"
  312.             Top             =   585
  313.             Width           =   2160
  314.          End
  315.          Begin VB.TextBox LrText 
  316.             Height          =   313
  317.             Index           =   1
  318.             Left            =   5640
  319.             TabIndex        =   1
  320.             Text            =   "1"
  321.             Top             =   585
  322.             Width           =   2160
  323.          End
  324.          Begin VB.TextBox LrText 
  325.             Height          =   313
  326.             Index           =   2
  327.             Left            =   1665
  328.             TabIndex        =   2
  329.             Text            =   "0"
  330.             Top             =   945
  331.             Width           =   2160
  332.          End
  333.          Begin VB.TextBox LrText 
  334.             Height          =   313
  335.             Index           =   3
  336.             Left            =   5640
  337.             TabIndex        =   3
  338.             Text            =   "1"
  339.             Top             =   945
  340.             Width           =   2160
  341.          End
  342.          Begin VB.TextBox LrText 
  343.             Height          =   313
  344.             Index           =   4
  345.             Left            =   1665
  346.             TabIndex        =   4
  347.             Text            =   "1"
  348.             Top             =   1320
  349.             Width           =   2160
  350.          End
  351.          Begin VB.CheckBox ChkStopUse 
  352.             Alignment       =   1  'Right Justify
  353.             Caption         =   "停用:"
  354.             Height          =   328
  355.             Left            =   645
  356.             TabIndex        =   28
  357.             Top             =   5700
  358.             Width           =   1230
  359.          End
  360.          Begin VB.CommandButton Ydcommand1 
  361.             Height          =   313
  362.             Index           =   3
  363.             Left            =   7770
  364.             Picture         =   "公用_客户设置.frx":1E3E
  365.             Style           =   1  'Graphical
  366.             TabIndex        =   31
  367.             Top             =   945
  368.             Width           =   301
  369.          End
  370.          Begin VB.CommandButton QxCommand 
  371.             Cancel          =   -1  'True
  372.             Caption         =   "取消(&C)"
  373.             Height          =   300
  374.             Left            =   7800
  375.             TabIndex        =   30
  376.             Top             =   178
  377.             Width           =   1120
  378.          End
  379.          Begin VB.CommandButton BcCommand 
  380.             Caption         =   "保存(&S)"
  381.             Height          =   300
  382.             Left            =   6648
  383.             TabIndex        =   29
  384.             Top             =   178
  385.             Width           =   1120
  386.          End
  387.          Begin VB.CommandButton Ydcommand1 
  388.             Height          =   313
  389.             Index           =   0
  390.             Left            =   3675
  391.             Picture         =   "公用_客户设置.frx":21C8
  392.             Style           =   1  'Graphical
  393.             TabIndex        =   39
  394.             Top             =   133
  395.             Visible         =   0   'False
  396.             Width           =   301
  397.          End
  398.          Begin VB.TextBox LrText 
  399.             Height          =   313
  400.             Index           =   25
  401.             Left            =   5640
  402.             TabIndex        =   25
  403.             Text            =   "1"
  404.             Top             =   5010
  405.             Width           =   2160
  406.          End
  407.          Begin VB.TextBox LrText 
  408.             Height          =   313
  409.             Index           =   27
  410.             Left            =   5640
  411.             TabIndex        =   27
  412.             Text            =   "1"
  413.             Top             =   5370
  414.             Width           =   2160
  415.          End
  416.          Begin VB.CommandButton Ydcommand1 
  417.             Height          =   313
  418.             Index           =   27
  419.             Left            =   7770
  420.             Picture         =   "公用_客户设置.frx":2552
  421.             Style           =   1  'Graphical
  422.             TabIndex        =   33
  423.             Top             =   5370
  424.             Width           =   301
  425.          End
  426.          Begin VB.CommandButton Ydcommand1 
  427.             Height          =   313
  428.             Index           =   25
  429.             Left            =   7770
  430.             Picture         =   "公用_客户设置.frx":28DC
  431.             Style           =   1  'Graphical
  432.             TabIndex        =   32
  433.             Top             =   5010
  434.             Width           =   301
  435.          End
  436.          Begin VB.Label TsLabel 
  437.             Caption         =   "分管部门:"
  438.             Height          =   180
  439.             Index           =   25
  440.             Left            =   4635
  441.             TabIndex        =   67
  442.             Top             =   5085
  443.             Width           =   810
  444.          End
  445.          Begin VB.Label TsLabel 
  446.             Caption         =   "所属业务员:"
  447.             Height          =   180
  448.             Index           =   26
  449.             Left            =   675
  450.             TabIndex        =   66
  451.             Top             =   5460
  452.             Width           =   990
  453.          End
  454.          Begin VB.Label TsLabel 
  455.             Caption         =   "发展日期:"
  456.             Height          =   180
  457.             Index           =   27
  458.             Left            =   4635
  459.             TabIndex        =   65
  460.             Top             =   5460
  461.             Width           =   810
  462.          End
  463.          Begin VB.Label TsLabel 
  464.             Caption         =   "信用等级:"
  465.             Height          =   180
  466.             Index           =   16
  467.             Left            =   675
  468.             TabIndex        =   64
  469.             Top             =   3615
  470.             Width           =   810
  471.          End
  472.          Begin VB.Label TsLabel 
  473.             Caption         =   "信用额度:"
  474.             Height          =   180
  475.             Index           =   17
  476.             Left            =   4635
  477.             TabIndex        =   63
  478.             Top             =   3615
  479.             Width           =   810
  480.          End
  481.          Begin VB.Label TsLabel 
  482.             Caption         =   "帐龄额度:"
  483.             Height          =   180
  484.             Index           =   18
  485.             Left            =   675
  486.             TabIndex        =   62
  487.             Top             =   3990
  488.             Width           =   810
  489.          End
  490.          Begin VB.Label TsLabel 
  491.             Caption         =   "信用天数:"
  492.             Height          =   180
  493.             Index           =   19
  494.             Left            =   4635
  495.             TabIndex        =   61
  496.             Top             =   3990
  497.             Width           =   810
  498.          End
  499.          Begin VB.Label TsLabel 
  500.             Caption         =   "最后交易日:"
  501.             Height          =   180
  502.             Index           =   20
  503.             Left            =   675
  504.             TabIndex        =   60
  505.             Top             =   4350
  506.             Width           =   990
  507.          End
  508.          Begin VB.Label TsLabel 
  509.             Caption         =   "最后交易额:"
  510.             Height          =   180
  511.             Index           =   21
  512.             Left            =   4635
  513.             TabIndex        =   59
  514.             Top             =   4350
  515.             Width           =   990
  516.          End
  517.          Begin VB.Label TsLabel 
  518.             Caption         =   "最后回款日:"
  519.             Height          =   180
  520.             Index           =   22
  521.             Left            =   675
  522.             TabIndex        =   58
  523.             Top             =   4710
  524.             Width           =   990
  525.          End
  526.          Begin VB.Label TsLabel 
  527.             Caption         =   "最后回款额:"
  528.             Height          =   180
  529.             Index           =   23
  530.             Left            =   4635
  531.             TabIndex        =   57
  532.             Top             =   4710
  533.             Width           =   990
  534.          End
  535.          Begin VB.Label TsLabel 
  536.             Caption         =   "应收余额:"
  537.             Height          =   180
  538.             Index           =   24
  539.             Left            =   675
  540.             TabIndex        =   56
  541.             Top             =   5085
  542.             Width           =   810
  543.          End
  544.          Begin VB.Label TsLabel 
  545.             Caption         =   "E-Mail:"
  546.             Height          =   180
  547.             Index           =   11
  548.             Left            =   4635
  549.             TabIndex        =   55
  550.             Top             =   2520
  551.             Width           =   630
  552.          End
  553.          Begin VB.Label TsLabel 
  554.             Caption         =   "客户网址:"
  555.             Height          =   180
  556.             Index           =   12
  557.             Left            =   675
  558.             TabIndex        =   54
  559.             Top             =   2880
  560.             Width           =   810
  561.          End
  562.          Begin VB.Label TsLabel 
  563.             Caption         =   "联系人:"
  564.             Height          =   180
  565.             Index           =   13
  566.             Left            =   4635
  567.             TabIndex        =   53
  568.             Top             =   2880
  569.             Width           =   630
  570.          End
  571.          Begin VB.Label TsLabel 
  572.             Caption         =   "联系方式:"
  573.             Height          =   180
  574.             Index           =   14
  575.             Left            =   675
  576.             TabIndex        =   52
  577.             Top             =   3255
  578.             Width           =   810
  579.          End
  580.          Begin VB.Label TsLabel 
  581.             Caption         =   "收货地址:"
  582.             Height          =   180
  583.             Index           =   15
  584.             Left            =   4635
  585.             TabIndex        =   51
  586.             Top             =   3255
  587.             Width           =   810
  588.          End
  589.          Begin VB.Label TsLabel 
  590.             Caption         =   "邮政编码:"
  591.             Height          =   180
  592.             Index           =   5
  593.             Left            =   4635
  594.             TabIndex        =   50
  595.             Top             =   1425
  596.             Width           =   810
  597.          End
  598.          Begin VB.Label TsLabel 
  599.             Caption         =   "法人名称:"
  600.             Height          =   180
  601.             Index           =   7
  602.             Left            =   4635
  603.             TabIndex        =   49
  604.             Top             =   1785
  605.             Width           =   810
  606.          End
  607.          Begin VB.Label TsLabel 
  608.             Caption         =   "开户银行:"
  609.             Height          =   180
  610.             Index           =   8
  611.             Left            =   675
  612.             TabIndex        =   48
  613.             Top             =   2160
  614.             Width           =   810
  615.          End
  616.          Begin VB.Label TsLabel 
  617.             Caption         =   "银行账号:"
  618.             Height          =   180
  619.             Index           =   9
  620.             Left            =   4635
  621.             TabIndex        =   47
  622.             Top             =   2160
  623.             Width           =   810
  624.          End
  625.          Begin VB.Label TsLabel 
  626.             Caption         =   "上级单位:"
  627.             Height          =   180
  628.             Index           =   10
  629.             Left            =   675
  630.             TabIndex        =   46
  631.             Top             =   2520
  632.             Width           =   810
  633.          End
  634.          Begin VB.Label TsLabel 
  635.             Caption         =   "税    号:"
  636.             Height          =   180
  637.             Index           =   6
  638.             Left            =   675
  639.             TabIndex        =   45
  640.             Top             =   1785
  641.             Width           =   810
  642.          End
  643.          Begin VB.Label TsLabel 
  644.             Caption         =   "客户编码:"
  645.             Height          =   180
  646.             Index           =   0
  647.             Left            =   675
  648.             TabIndex        =   44
  649.             Top             =   690
  650.             Width           =   810
  651.          End
  652.          Begin VB.Label TsLabel 
  653.             Caption         =   "客户名称:"
  654.             Height          =   180
  655.             Index           =   1
  656.             Left            =   4635
  657.             TabIndex        =   43
  658.             Top             =   690
  659.             Width           =   810
  660.          End
  661.          Begin VB.Label TsLabel 
  662.             Caption         =   "所属地区:"
  663.             Height          =   180
  664.             Index           =   2
  665.             Left            =   675
  666.             TabIndex        =   42
  667.             Top             =   1050
  668.             Width           =   810
  669.          End
  670.          Begin VB.Label TsLabel 
  671.             Caption         =   "所属行业:"
  672.             Height          =   180
  673.             Index           =   3
  674.             Left            =   4635
  675.             TabIndex        =   41
  676.             Top             =   1050
  677.             Width           =   810
  678.          End
  679.          Begin VB.Label TsLabel 
  680.             Caption         =   "客户地址:"
  681.             Height          =   180
  682.             Index           =   4
  683.             Left            =   675
  684.             TabIndex        =   40
  685.             Top             =   1425
  686.             Width           =   810
  687.          End
  688.       End
  689.       Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
  690.          Height          =   6105
  691.          Left            =   90
  692.          TabIndex        =   34
  693.          Top             =   405
  694.          Width           =   9030
  695.          _cx             =   5080
  696.          _cy             =   5080
  697.          Appearance      =   1
  698.          BorderStyle     =   1
  699.          Enabled         =   -1  'True
  700.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  701.             Name            =   "宋体"
  702.             Size            =   9
  703.             Charset         =   134
  704.             Weight          =   400
  705.             Underline       =   0   'False
  706.             Italic          =   0   'False
  707.             Strikethrough   =   0   'False
  708.          EndProperty
  709.          MousePointer    =   0
  710.          BackColor       =   -2147483643
  711.          ForeColor       =   -2147483640
  712.          BackColorFixed  =   -2147483633
  713.          ForeColorFixed  =   -2147483630
  714.          BackColorSel    =   -2147483635
  715.          ForeColorSel    =   -2147483634
  716.          BackColorBkg    =   8421504
  717.          BackColorAlternate=   -2147483643
  718.          GridColor       =   -2147483633
  719.          GridColorFixed  =   -2147483632
  720.          TreeColor       =   -2147483632
  721.          FloodColor      =   192
  722.          SheetBorder     =   -2147483642
  723.          FocusRect       =   1
  724.          HighLight       =   1
  725.          AllowSelection  =   -1  'True
  726.          AllowBigSelection=   -1  'True
  727.          AllowUserResizing=   0
  728.          SelectionMode   =   0
  729.          GridLines       =   1
  730.          GridLinesFixed  =   2
  731.          GridLineWidth   =   1
  732.          Rows            =   5000
  733.          Cols            =   10
  734.          FixedRows       =   1
  735.          FixedCols       =   0
  736.          RowHeightMin    =   0
  737.          RowHeightMax    =   0
  738.          ColWidthMin     =   0
  739.          ColWidthMax     =   0
  740.          ExtendLastCol   =   0   'False
  741.          FormatString    =   ""
  742.          ScrollTrack     =   0   'False
  743.          ScrollBars      =   3
  744.          ScrollTips      =   0   'False
  745.          MergeCells      =   0
  746.          MergeCompare    =   0
  747.          AutoResize      =   -1  'True
  748.          AutoSizeMode    =   0
  749.          AutoSearch      =   0
  750.          AutoSearchDelay =   2
  751.          MultiTotals     =   -1  'True
  752.          SubtotalPosition=   1
  753.          OutlineBar      =   0
  754.          OutlineCol      =   0
  755.          Ellipsis        =   0
  756.          ExplorerBar     =   0
  757.          PicturesOver    =   0   'False
  758.          FillStyle       =   0
  759.          RightToLeft     =   0   'False
  760.          PictureType     =   0
  761.          TabBehavior     =   0
  762.          OwnerDraw       =   0
  763.          Editable        =   0
  764.          ShowComboButton =   1
  765.          WordWrap        =   0   'False
  766.          TextStyle       =   0
  767.          TextStyleFixed  =   0
  768.          OleDragMode     =   0
  769.          OleDropMode     =   0
  770.          DataMode        =   0
  771.          VirtualData     =   -1  'True
  772.          DataMember      =   ""
  773.          ComboSearch     =   3
  774.          AutoSizeMouse   =   -1  'True
  775.          FrozenRows      =   0
  776.          FrozenCols      =   0
  777.          AllowUserFreezing=   0
  778.          BackColorFrozen =   0
  779.          ForeColorFrozen =   0
  780.          WallPaperAlignment=   9
  781.          AccessibleName  =   ""
  782.          AccessibleDescription=   ""
  783.          AccessibleValue =   ""
  784.          AccessibleRole  =   24
  785.       End
  786.    End
  787.    Begin MSComctlLib.Toolbar SzToolbar 
  788.       Align           =   1  'Align Top
  789.       Height          =   555
  790.       Left            =   0
  791.       TabIndex        =   36
  792.       Top             =   0
  793.       Width           =   9270
  794.       _ExtentX        =   16351
  795.       _ExtentY        =   979
  796.       ButtonWidth     =   820
  797.       ButtonHeight    =   926
  798.       AllowCustomize  =   0   'False
  799.       Appearance      =   1
  800.       Style           =   1
  801.       ImageList       =   "ImageList1"
  802.       _Version        =   393216
  803.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  804.          NumButtons      =   13
  805.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  806.             Caption         =   "设置"
  807.             Key             =   "ymsz"
  808.             ImageKey        =   "sz"
  809.          EndProperty
  810.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  811.             Caption         =   "打印"
  812.             Key             =   "dy"
  813.             Object.ToolTipText     =   "点击或按Ctrl+P打印表格"
  814.             ImageKey        =   "dy"
  815.          EndProperty
  816.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  817.             Caption         =   "预览"
  818.             Key             =   "yl"
  819.             ImageKey        =   "yl"
  820.          EndProperty
  821.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  822.             Style           =   3
  823.          EndProperty
  824.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  825.             Caption         =   "增加"
  826.             Key             =   "zj"
  827.             Object.ToolTipText     =   "点击或按Ctrl+A增加记录"
  828.             ImageKey        =   "xz"
  829.          EndProperty
  830.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  831.             Caption         =   "修改"
  832.             Key             =   "xg"
  833.             ImageKey        =   "xg"
  834.          EndProperty
  835.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  836.             Caption         =   "删除"
  837.             Key             =   "sc"
  838.             Object.ToolTipText     =   "点击或按Ctrl+D删除当前记录"
  839.             ImageKey        =   "sc"
  840.          EndProperty
  841.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  842.             Style           =   3
  843.          EndProperty
  844.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  845.             Caption         =   "查询"
  846.             Key             =   "cx"
  847.             ImageIndex      =   24
  848.          EndProperty
  849.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  850.             Caption         =   "刷新"
  851.             Key             =   "sx"
  852.             ImageKey        =   "sx"
  853.          EndProperty
  854.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  855.             Style           =   3
  856.          EndProperty
  857.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  858.             Caption         =   "帮助"
  859.             Key             =   "bz"
  860.             ImageKey        =   "bz"
  861.          EndProperty
  862.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  863.             Caption         =   "退出"
  864.             Key             =   "fh"
  865.             ImageKey        =   "tc"
  866.          EndProperty
  867.       EndProperty
  868.       BorderStyle     =   1
  869.       Begin MSComctlLib.Toolbar GsToolbar 
  870.          Height          =   525
  871.          Left            =   6795
  872.          TabIndex        =   37
  873.          Top             =   0
  874.          Width           =   2475
  875.          _ExtentX        =   4366
  876.          _ExtentY        =   926
  877.          ButtonWidth     =   1455
  878.          ButtonHeight    =   926
  879.          AllowCustomize  =   0   'False
  880.          Appearance      =   1
  881.          Style           =   1
  882.          ImageList       =   "ImageList1"
  883.          _Version        =   393216
  884.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  885.             NumButtons      =   3
  886.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  887.                Caption         =   "保存格式"
  888.                Key             =   "bcgs"
  889.                ImageKey        =   "bcgs"
  890.             EndProperty
  891.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  892.                Caption         =   "默认列宽"
  893.                Key             =   "hfmrgs"
  894.                ImageKey        =   "mrlk"
  895.             EndProperty
  896.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  897.                Caption         =   "显示项目"
  898.                Key             =   "szxsxm"
  899.                ImageKey        =   "xsxm"
  900.             EndProperty
  901.          EndProperty
  902.       End
  903.    End
  904.    Begin MSComctlLib.ImageList ImageList1 
  905.       Left            =   0
  906.       Top             =   420
  907.       _ExtentX        =   1005
  908.       _ExtentY        =   1005
  909.       BackColor       =   -2147483643
  910.       ImageWidth      =   16
  911.       ImageHeight     =   16
  912.       MaskColor       =   12632256
  913.       _Version        =   393216
  914.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  915.          NumListImages   =   29
  916.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  917.             Picture         =   "公用_客户设置.frx":2C66
  918.             Key             =   "sz"
  919.          EndProperty
  920.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  921.             Picture         =   "公用_客户设置.frx":3000
  922.             Key             =   "dy"
  923.          EndProperty
  924.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  925.             Picture         =   "公用_客户设置.frx":339A
  926.             Key             =   "yl"
  927.          EndProperty
  928.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  929.             Picture         =   "公用_客户设置.frx":3734
  930.             Key             =   "xg"
  931.          EndProperty
  932.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  933.             Picture         =   "公用_客户设置.frx":3ACE
  934.             Key             =   "zh"
  935.          EndProperty
  936.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  937.             Picture         =   "公用_客户设置.frx":3E68
  938.             Key             =   "sh"
  939.          EndProperty
  940.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  941.             Picture         =   "公用_客户设置.frx":4202
  942.             Key             =   "bc"
  943.          EndProperty
  944.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  945.             Picture         =   "公用_客户设置.frx":459C
  946.             Key             =   "fq"
  947.          EndProperty
  948.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  949.             Picture         =   "公用_客户设置.frx":4936
  950.             Key             =   "bz"
  951.          EndProperty
  952.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  953.             Picture         =   "公用_客户设置.frx":4CD0
  954.             Key             =   "tc"
  955.          EndProperty
  956.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  957.             Picture         =   "公用_客户设置.frx":506A
  958.             Key             =   "bcgs"
  959.          EndProperty
  960.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  961.             Picture         =   "公用_客户设置.frx":5404
  962.             Key             =   "mrlk"
  963.          EndProperty
  964.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  965.             Picture         =   "公用_客户设置.frx":579E
  966.             Key             =   "xsxm"
  967.          EndProperty
  968.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  969.             Picture         =   "公用_客户设置.frx":5B38
  970.             Key             =   "first"
  971.          EndProperty
  972.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  973.             Picture         =   "公用_客户设置.frx":5ED2
  974.             Key             =   "prev"
  975.          EndProperty
  976.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  977.             Picture         =   "公用_客户设置.frx":626C
  978.             Key             =   "next"
  979.          EndProperty
  980.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  981.             Picture         =   "公用_客户设置.frx":6606
  982.             Key             =   "last"
  983.          EndProperty
  984.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  985.             Picture         =   "公用_客户设置.frx":69A0
  986.             Key             =   "xx"
  987.          EndProperty
  988.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  989.             Picture         =   "公用_客户设置.frx":6D3A
  990.             Key             =   "define"
  991.          EndProperty
  992.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  993.             Picture         =   "公用_客户设置.frx":70D4
  994.             Key             =   "exec"
  995.          EndProperty
  996.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  997.             Picture         =   "公用_客户设置.frx":746E
  998.             Key             =   "xz"
  999.          EndProperty
  1000.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1001.             Picture         =   "公用_客户设置.frx":7808
  1002.             Key             =   "sc"
  1003.          EndProperty
  1004.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1005.             Picture         =   "公用_客户设置.frx":7BA2
  1006.             Key             =   "sx"
  1007.          EndProperty
  1008.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1009.             Picture         =   "公用_客户设置.frx":7F3C
  1010.             Key             =   "cx"
  1011.          EndProperty
  1012.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1013.             Picture         =   "公用_客户设置.frx":82D6
  1014.             Key             =   "zd"
  1015.          EndProperty
  1016.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1017.             Picture         =   "公用_客户设置.frx":8670
  1018.             Key             =   "dz"
  1019.          EndProperty
  1020.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1021.             Picture         =   "公用_客户设置.frx":8A0A
  1022.             Key             =   "ph"
  1023.          EndProperty
  1024.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1025.             Picture         =   "公用_客户设置.frx":8DA4
  1026.             Key             =   "fz"
  1027.          EndProperty
  1028.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1029.             Picture         =   "公用_客户设置.frx":913E
  1030.             Key             =   "dw"
  1031.          EndProperty
  1032.       EndProperty
  1033.    End
  1034. End
  1035. Attribute VB_Name = "Gy_Customer"
  1036. Attribute VB_GlobalNameSpace = False
  1037. Attribute VB_Creatable = False
  1038. Attribute VB_PredeclaredId = True
  1039. Attribute VB_Exposed = False
  1040. '*******************************************************
  1041. '*    模 块 名 称 :客户档案设置
  1042. '*    功 能 描 述 :设置往来客户档案
  1043. '*    程序员姓名  :徐强
  1044. '*    最后修改人  :徐强
  1045. '*    最后修改时间:2001/11/27
  1046. '*    备        注:
  1047. '*******************************************************
  1048. Dim Rec_CodeSet As New ADODB.Recordset   '编码设置表
  1049. Dim jdzygs As Integer                    '控件焦点转移个数
  1050. Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
  1051. Dim ReportTitle As String                '报表主标题
  1052. Dim Str_RightEdit As String              '编辑(新增、修改、删除)权限索引
  1053. '以下为固定使用变量(网格)
  1054. Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
  1055. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  1056. Dim GridCode As String                   '显示网格网格代码
  1057. Dim GridInf() As Variant                 '整个网格设置信息
  1058. Dim Tsxx As String                       '系统提示信息
  1059. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  1060. Dim Sjhgd As Double                      '网格数据行高度
  1061. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  1062. Dim GridStr()  As String                 '网格列信息(字符型)
  1063. Dim GridInt() As Integer                 '网格列信息(整型)
  1064. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  1065. '以下为固定使用变量(文本框)
  1066. Dim Textvar() As Variant                 '存储变体型文本框信息
  1067. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  1068. Dim Textint() As Integer                 '存储整型文本框信息
  1069. Dim Textstr() As String                  '存储字符型文本框信息
  1070. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  1071. Dim TextGroupCode As String              '文本框录入分组编码
  1072. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  1073. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  1074. Dim CurTextIndex As Integer              '当前文本框索引值
  1075. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  1076. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  1077. Dim str_cusname As String                '客户名称
  1078. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移
  1079.     jdzygs = 34
  1080.     
  1081.     Select Case KeyAscii
  1082.         Case vbKeyReturn
  1083.             If Kjjdzy(jdzygs) Then
  1084.                 KeyAscii = 0
  1085.             End If
  1086.         Case 39           '屏蔽"'"
  1087.             KeyAscii = 0
  1088.    End Select
  1089.    
  1090. End Sub
  1091. Private Sub Form_Load()
  1092.   
  1093.     '打印报表标题信息
  1094.     ReportTitle = "客 户 设 置"
  1095.      
  1096.     '调入打印页面设置窗体
  1097.     XtReportCode = "Gy_Customer"
  1098.     Load Dyymctbl
  1099.     
  1100.     '以下为文本框处理程序(读入文本框录入信息)
  1101.     TextGroupCode = "Gy_Customer"
  1102.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
  1103.     Call Wbkcsh
  1104.     
  1105.     '调入网格设置信息
  1106.     GridCode = "Gy_Customer"
  1107.     Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  1108.     Qslz = GridInf(1)
  1109.     Sjhgd = GridInf(2)
  1110.     Szzls = CzxsGrid.Cols - 1
  1111.     
  1112.     '填 充 网 格
  1113.        
  1114.     '初始化toolbar,tab卡状态
  1115.     StTab.Tab = 0
  1116.     StTab.TabEnabled(1) = False
  1117.     Frame1.Enabled = False
  1118.      
  1119.     '设置为非录入状态
  1120.     Lrzt = 0
  1121.     
  1122.     '编辑(新增、修改、删除)权限索引
  1123.     Str_RightEdit = "Gy_Customer_Edit"
  1124. End Sub
  1125.  
  1126. Private Sub Cxnrtcwg(Optional Sqlstr As String)                                '查询内容填充网格
  1127.     Dim jsqte As Long                 '查询临时使用变量
  1128.   
  1129.     '为加快显示速度,将网格刷新动作冻结
  1130.     CzxsGrid.Redraw = False
  1131.   
  1132.     '[>>查询连接串
  1133.     If Sqlstr = "" Then
  1134.         Sqlstr = "SELECT * FROM Gy_V_Customer order by CusCode"
  1135.     End If
  1136.     '<<]
  1137.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1138.     
  1139.     With Cxnrrec
  1140.         CzxsGrid.Rows = CzxsGrid.FixedRows
  1141.         If .EOF And .BOF Then
  1142.             CzxsGrid.Redraw = True
  1143.             Exit Sub
  1144.         End If
  1145.         
  1146.         jsqte = CzxsGrid.FixedRows
  1147.         
  1148.         Do While Not .EOF
  1149.             CzxsGrid.AddItem ""
  1150.             Call Jltcwg(Cxnrrec, jsqte)                              '调入填充网格子过程
  1151.             CzxsGrid.RowHeight(jsqte) = Sjhgd                        '设置网格高度
  1152.             .MoveNext
  1153.             jsqte = jsqte + 1
  1154.         Loop
  1155.     End With
  1156.   
  1157.     '将网格刷新动作解冻
  1158.     CzxsGrid.Redraw = True
  1159.     
  1160. End Sub
  1161. Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long)           '记录内容填充网格
  1162.     '[>>以下为自定义部分
  1163.     With Jlbrec
  1164.         CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("CusCode") & "")            '客户编码
  1165.         CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("CusName") & "")            '客户名称
  1166.         CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("AreaName") & "")           '所属地区
  1167.         CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("TradeName") & "")          '所属行业
  1168.         CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("Address") & "")            '客户地址
  1169.         CzxsGrid.TextMatrix(Rowjsq, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("PostCode") & "")           '邮政编码
  1170.         CzxsGrid.TextMatrix(Rowjsq, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("TaxCode") & "")            '税号
  1171.         CzxsGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("FictPerson") & "")         '法人名称
  1172.         CzxsGrid.TextMatrix(Rowjsq, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("Bank") & "")               '开户银行
  1173.         CzxsGrid.TextMatrix(Rowjsq, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("BankAccount") & "")        '银行账号
  1174.         CzxsGrid.TextMatrix(Rowjsq, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("CusSuper") & "")           '上级单位
  1175.         CzxsGrid.TextMatrix(Rowjsq, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("Deptname") & "")           '分管部门
  1176.         CzxsGrid.TextMatrix(Rowjsq, Sydz("013", GridStr(), Szzls)) = Trim(.Fields("Personname") & "")         '所属业务员
  1177.         CzxsGrid.TextMatrix(Rowjsq, Sydz("014", GridStr(), Szzls)) = Trim(.Fields("StopFlag") & "")           '停用
  1178.         CzxsGrid.TextMatrix(Rowjsq, Sydz("015", GridStr(), Szzls)) = Trim(.Fields("CreditGrade") & "")        '信用等级
  1179.         CzxsGrid.TextMatrix(Rowjsq, Sydz("016", GridStr(), Szzls)) = Trim(.Fields("CreditMoney") & "")        '信用额度
  1180.         CzxsGrid.TextMatrix(Rowjsq, Sydz("017", GridStr(), Szzls)) = Trim(.Fields("CreditageMoney") & "")     '帐龄额度
  1181.         CzxsGrid.TextMatrix(Rowjsq, Sydz("018", GridStr(), Szzls)) = Trim(.Fields("CreditDate") & "")         '信用天数
  1182.     End With
  1183.     '以上为自定义部分<<]
  1184.     
  1185. End Sub
  1186. Private Sub Form_Unload(Cancel As Integer)             '窗体卸载
  1187.     Set Cxnrrec = Nothing
  1188.     Set Rec_CodeSet = Nothing
  1189.     Unload Dyymctbl
  1190.     Gy_CustomerQuery.UnloadCheck = 1
  1191.     Unload Gy_CustomerQuery
  1192. End Sub
  1193. Private Function Bclrsj() As Boolean                   '判断录入数据有效性,并保存数据
  1194.     Dim jsqte As Integer
  1195.     Dim i As Long
  1196.     Dim str_tmp As String
  1197.     Dim likenum As Long
  1198.     Dim rs As New ADODB.Recordset
  1199.     Dim intyesno As Integer
  1200.     
  1201.     '对文本框录入内容进行为零和为空判断(固定不变)
  1202.     With Rec_CodeSet
  1203.     
  1204.         For jsqte = 0 To Max_Text_Index
  1205.             If Textint(jsqte, 8) = 1 Then     '字段不能为空
  1206.                 If Len(Trim(LrText(jsqte).Text)) = 0 Then
  1207.                     Tsxx = Textstr(jsqte, 7) & "不能为空!"
  1208.                     Call Xtxxts(Tsxx, 0, 1)
  1209.                     LrText(jsqte).SetFocus
  1210.                     Bclrsj = False
  1211.                     Exit Function
  1212.                 End If
  1213.             Else
  1214.                 If Textint(jsqte, 8) = 2 Then   '字段不能为零
  1215.                     If Val(Trim(LrText(jsqte).Text)) = 0 Then
  1216.                         Tsxx = Textstr(jsqte, 7) & "不能为零!"
  1217.                         Call Xtxxts(Tsxx, 0, 1)
  1218.                         LrText(jsqte).SetFocus
  1219.                         Bclrsj = False
  1220.                         Exit Function
  1221.                     End If
  1222.                 End If
  1223.             End If
  1224.         Next jsqte
  1225.     
  1226.         '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
  1227.         For jsqte = 0 To Max_Text_Index
  1228.             If Textint(jsqte, 9) = 0 Or Textint(jsqte, 9) = 2 Then
  1229.                 If Not TextYxxpd(jsqte) Then
  1230.                     Exit Function
  1231.                 End If
  1232.             End If
  1233.         Next jsqte
  1234.         If Lrzt = 1 Then  '增 加
  1235.         
  1236.             '[>>判断编码是否重复
  1237.             If .State = 1 Then .Close
  1238.             .Open "SELECT * FROM Gy_Customer WHERE CusCode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1239.     
  1240.             If Not .EOF Then
  1241.                 Tsxx = "客户编码重复!"
  1242.                 Call Xtxxts(Tsxx, 0, 1)
  1243.                 LrText(0).SetFocus
  1244.                 Bclrsj = False
  1245.                 Exit Function
  1246.             End If
  1247.         '******************************************
  1248.         '计算客户名称相似率(相同字的个数/长度)
  1249.         likenum = 0
  1250.         j = 0
  1251.         'rs用于取出相似率
  1252.         rs.Open "select itemvalue from gy_accinformation where itemcode='gy_customer'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1253.         If .State = 1 Then .Close
  1254.         .Open "SELECT cusname FROM Gy_Customer ", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1255.         str_tmp = Trim(LrText(1))
  1256.         Do While Not .EOF
  1257.             For i = 1 To Len(str_tmp)
  1258.                 If InStr(1, Trim(.Fields("cusname")), Mid(str_tmp, i, 1)) Then
  1259.                     likenum = likenum + 1
  1260.                 End If
  1261.             Next
  1262.             
  1263.             If likenum * 100# / Len(str_tmp) > Val(rs("itemvalue")) Then
  1264.                 cusname = cusname & "        " & Trim(.Fields("cusname")) & "     " & Chr(13)
  1265.             End If
  1266.             likenum = 0
  1267.             .MoveNext
  1268.         Loop
  1269.         If Len(cusname) > 0 Then
  1270.             Tsxx = "存在相似的客户名称:" & Chr(13) & suppliername & "要继续吗?"
  1271.             If Xtxxts(Tsxx, 1, 2) = vbNo Then
  1272.                 LrText(1).SetFocus
  1273.                 Bclrsj = False
  1274.                 Exit Function
  1275.             End If
  1276.         End If
  1277.     
  1278.         Set rs = Nothing
  1279.         '****************************************************
  1280.             If .State = 1 Then .Close
  1281.             .Open "SELECT * FROM Gy_Customer WHERE 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1282.             '判断记录内容无误后,将记录内容写入数据表
  1283.             On Error GoTo Swcwcl
  1284.     
  1285.             Cw_DataEnvi.DataConnect.BeginTrans
  1286.    
  1287.             .AddNew
  1288.             .Fields("CusCode") = Trim(LrText(0).Text)          '客户编码
  1289.             .Fields("CusName") = Trim(LrText(1).Text)          '客户名称
  1290.             If Trim(LrText(2).Tag) <> "" Then                  '地区编码
  1291.                 .Fields("Areacode") = Trim(LrText(2).Tag)
  1292.             Else
  1293.                 .Fields("Areacode") = Null
  1294.             End If
  1295.             If Trim(LrText(3).Tag) <> "" Then                  '行业编码
  1296.                 .Fields("Tradecode") = Trim(LrText(3).Tag)
  1297.             Else
  1298.                 .Fields("Tradecode") = Null
  1299.             End If
  1300.             .Fields("Address") = Trim(LrText(4).Text)          '地址
  1301.             .Fields("postcode") = Trim(LrText(5))              '邮编
  1302.             .Fields("taxcode") = Trim(LrText(6))               '税号
  1303.             .Fields("fictperson") = Trim(LrText(7))            '法人
  1304.             .Fields("bank") = Trim(LrText(8).Text)             '开户银行
  1305.             .Fields("bankaccount") = Trim(LrText(9).Text)      '银行账号
  1306.             .Fields("Cussuper") = Trim(LrText(10).Text)        '上级主管公司
  1307.             .Fields("email") = Trim(LrText(11).Text)           'email
  1308.             .Fields("worknet") = Trim(LrText(12).Text)         '网址
  1309.             .Fields("contactperson") = Trim(LrText(13).Text)   '联系人
  1310.             .Fields("contacttype") = Trim(LrText(14).Text)     '联系方式
  1311.             .Fields("desaddress") = Trim(LrText(15).Text)      '收获地址
  1312.             
  1313.             .Fields("creditgrade") = Trim(LrText(16).Text)     '信用等级
  1314.             .Fields("creditmoney") = Val(LrText(17).Text)      '信用额度
  1315.             .Fields("creditagemoney") = Val(LrText(18).Text)   '帐龄额度
  1316.             If IsDate(LrText(19).Text) Then
  1317.                 .Fields("creditdate") = Trim(LrText(19).Text)  '信用天数
  1318.             End If
  1319.             
  1320.             If Trim(LrText(25).Tag) <> "" Then                 '公司分管部门
  1321.                  .Fields("deptcode") = Trim(LrText(25).Tag)
  1322.              Else
  1323.                  .Fields("deptcode") = Null
  1324.              End If
  1325.              If Trim(LrText(26).Tag) <> "" Then                '所属销售员
  1326.                  .Fields("PersonCode") = Trim(LrText(26).Tag)
  1327.              Else
  1328.                  .Fields("PersonCode") = Null
  1329.              End If
  1330.              If IsDate(LrText(27)) Then                        '发展日期
  1331.                  .Fields("relationdate") = LrText(27)
  1332.              Else
  1333.                  .Fields("relationdate") = Null
  1334.              End If
  1335.             
  1336.              
  1337.              If ChkStopUse.Value Then           '停用标志
  1338.                  .Fields("stopflag") = 1
  1339.              Else
  1340.                  .Fields("stopflag") = 0
  1341.              End If
  1342.            
  1343.             .Update
  1344.             Cw_DataEnvi.DataConnect.CommitTrans
  1345.             '将记录加入网格
  1346.             Sqlstr = "SELECT * FROM Gy_V_Customer WHERE CusCode= '" + Trim(LrText(0).Text) + "'"
  1347.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1348.    
  1349.             With CzxsGrid
  1350.                 .AddItem ""
  1351.                 .RowHeight(.Rows - 1) = Sjhgd
  1352.                 .Select .Rows - 1, Qslz
  1353.                 Call Jltcwg(Cxnrrec, .Rows - 1)
  1354.             End With
  1355.             Tsxx = "保存完毕!"
  1356.             Call Xtxxts(Tsxx, 0, 4)
  1357.             
  1358.             Call Cshlrxx(1)
  1359.             LrText(0).SetFocus
  1360.             '将网格按编码排序
  1361.             With CzxsGrid
  1362.                 .Col = Sydz("001", GridStr(), Szzls)
  1363.                 CzxsGrid.Sort = flexSortStringAscending
  1364.             End With
  1365.             '<<]
  1366.     
  1367.         Else  '否则为修改记录
  1368.  
  1369.             '******************************************
  1370.             '计算客户名称相似率(相同字的个数/长度)
  1371.             If Trim(LrText(1)) <> str_cusname Then '如果客户名称改变
  1372.                 str_cusname = ""
  1373.                 likenum = 0
  1374.                 j = 0
  1375.                 'rs用于取出相似率
  1376.                 rs.Open "select itemvalue from gy_accinformation where itemcode='gy_customer'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1377.                 If .State = 1 Then .Close
  1378.                 .Open "SELECT cusname FROM Gy_Customer where cuscode<>'" & Trim(LrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1379.                 str_tmp = Trim(LrText(1))
  1380.                 Do While Not .EOF
  1381.                     For i = 1 To Len(str_tmp)
  1382.                         If InStr(1, Trim(.Fields("cusname")), Mid(str_tmp, i, 1)) Then
  1383.                             likenum = likenum + 1
  1384.                         End If
  1385.                     Next
  1386.                     
  1387.                     If likenum * 100# / Len(str_tmp) > Val(rs("itemvalue")) Then
  1388.                         cusname = cusname & "        " & Trim(.Fields("cusname")) & "     " & Chr(13)
  1389.                     End If
  1390.                     likenum = 0
  1391.                     .MoveNext
  1392.                 Loop
  1393.                 If Len(cusname) > 0 Then
  1394.                     Tsxx = "存在相似的客户名称:" & Chr(13) & suppliername & "要继续吗?"
  1395.                     If Xtxxts(Tsxx, 1, 2) = vbNo Then
  1396.                         LrText(1).SetFocus
  1397.                         Bclrsj = False
  1398.                         Exit Function
  1399.                     End If
  1400.                 End If
  1401.         
  1402.                 Set rs = Nothing
  1403.             End If
  1404.             '****************************************************
  1405.             On Error GoTo Swcwcl
  1406.             Cw_DataEnvi.DataConnect.BeginTrans
  1407.             If .State = 1 Then .Close
  1408.             .Open "SELECT * FROM Gy_Customer WHERE CusCode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1409.      
  1410.             If Not .EOF Then
  1411.                 .Fields("CusName") = Trim(LrText(1).Text)          '客户名称
  1412.                 If Trim(LrText(2).Tag) <> "" Then                  '地区编码
  1413.                     .Fields("Areacode") = Trim(LrText(2).Tag)
  1414.                 Else
  1415.                     .Fields("Areacode") = Null
  1416.                 End If
  1417.                 If Trim(LrText(3).Tag) <> "" Then                  '行业编码
  1418.                     .Fields("Tradecode") = Trim(LrText(3).Tag)
  1419.                 Else
  1420.                     .Fields("Tradecode") = Null
  1421.                 End If
  1422.                 .Fields("Address") = Trim(LrText(4).Text)          '地址
  1423.                 .Fields("postcode") = Trim(LrText(5))              '邮编
  1424.                 .Fields("taxcode") = Trim(LrText(6))               '税号
  1425.                 .Fields("fictperson") = Trim(LrText(7))            '法人
  1426.                 .Fields("bank") = Trim(LrText(8).Text)             '开户银行
  1427.                 .Fields("bankaccount") = Trim(LrText(9).Text)      '银行账号
  1428.                 .Fields("Cussuper") = Trim(LrText(10).Text)        '上级主管公司
  1429.                 .Fields("email") = Trim(LrText(11).Text)           'email
  1430.                 .Fields("worknet") = Trim(LrText(12).Text)         '网址
  1431.                 .Fields("contactperson") = Trim(LrText(13).Text)   '联系人
  1432.                 .Fields("contacttype") = Trim(LrText(14).Text)     '联系方式
  1433.                 .Fields("desaddress") = Trim(LrText(15).Text)      '收获地址
  1434.                 
  1435.                 .Fields("creditgrade") = Trim(LrText(16).Text)     '信用等级
  1436.                 .Fields("creditmoney") = Val(LrText(17).Text)      '信用额度
  1437.                 .Fields("creditagemoney") = Val(LrText(18).Text)   '帐龄额度
  1438.                 If IsDate(LrText(19).Text) Then
  1439.                     .Fields("creditdate") = Trim(LrText(19).Text)  '信用天数
  1440.                 End If
  1441.                 
  1442.                 
  1443.                 If Trim(LrText(25).Tag) <> "" Then                 '公司分管部门
  1444.                      .Fields("deptcode") = Trim(LrText(25).Tag)
  1445.                  Else
  1446.                      .Fields("deptcode") = Null
  1447.                  End If
  1448.                  If Trim(LrText(26).Tag) <> "" Then                '所属销售员
  1449.                      .Fields("PersonCode") = Trim(LrText(26).Tag)
  1450.                  Else
  1451.                      .Fields("PersonCode") = Null
  1452.                  End If
  1453.                  If IsDate(LrText(27)) Then                        '发展日期
  1454.                      .Fields("relationdate") = LrText(27)
  1455.                  Else
  1456.                      .Fields("relationdate") = Null
  1457.                  End If
  1458.                 
  1459.                  
  1460.                  If ChkStopUse.Value Then           '停用标志
  1461.                      .Fields("stopflag") = 1
  1462.                  Else
  1463.                      .Fields("stopflag") = 0
  1464.                  End If
  1465.                     .Update
  1466.                 End If
  1467.              Cw_DataEnvi.DataConnect.CommitTrans
  1468.    
  1469.             '刷新当前网格
  1470.             Sqlstr = "SELECT * FROM Gy_V_Customer WHERE CusCode= '" + Trim(LrText(0).Text) + "'"
  1471.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1472.    
  1473.             With CzxsGrid
  1474.                 Call Jltcwg(Cxnrrec, .Row)
  1475.             End With
  1476.    
  1477.         End If
  1478.      
  1479.         '保存记录成功,函数返回真值
  1480.         Bclrsj = True
  1481.         Exit Function
  1482.         
  1483.     End With
  1484.  
  1485. Swcwcl:
  1486.      Cw_DataEnvi.DataConnect.RollbackTrans
  1487.      
  1488.      Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
  1489.      Call Xtxxts(Tsxx, 0, 1)
  1490.      
  1491.      Exit Function
  1492.      
  1493. End Function
  1494. Private Function Cshlrxx(lrztxx As Integer) As Boolean              '初始化录入字段信息
  1495.     Dim RecTemp As New ADODB.Recordset
  1496.     TextChangeLock = True       '关闭文本框Chang事件
  1497.     Call mmkn
  1498.     str_cusname = ""
  1499.     If lrztxx = 1 Then
  1500.         '增加新记录时将文本框清空
  1501.         For jsqte = 0 To Max_Text_Index
  1502.             If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  1503.                 LrText(jsqte).Text = ""
  1504.                 LrText(jsqte).Tag = ""
  1505.             End If
  1506.             TextValiJudgeLock(jsqte) = True
  1507.         Next jsqte
  1508.     
  1509.         '[>>
  1510.         '在此处可添加新增记录时初始化设置
  1511.         '<<]
  1512.     Else
  1513.     
  1514.         '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
  1515.         With RecTemp
  1516.             Sqlstr = "SELECT * FROM Gy_V_Customer Where CusCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) & "'"
  1517.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1518.        
  1519.             '记录如存在则读入其内容,否则提示记录已被其他人删除
  1520.             If Not RecTemp.EOF Then
  1521.                 
  1522.                 Call ShowData(RecTemp)
  1523.             Else
  1524.                 Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
  1525.                 Call Xtxxts(Tsxx, 0, 4)
  1526.                 Call Cancel
  1527.                 TextChangeLock = False
  1528.                 Exit Function
  1529.             End If
  1530.         End With
  1531.     End If
  1532.     
  1533.     Cshlrxx = True
  1534.     TextChangeLock = False
  1535.     
  1536. End Function
  1537. Private Sub ShowData(rs As ADODB.Recordset)
  1538.     With rs
  1539.         
  1540.         LrText(0) = Trim(.Fields("CusCode") & "")                 '客户编码
  1541.         LrText(1) = Trim(.Fields("CusName") & "")                 '客户名称
  1542.         LrText(2) = Trim(.Fields("Areaname") & "")                '地区名称
  1543.         LrText(3) = Trim(.Fields("Tradename") & "")               '行业名称
  1544.         LrText(4) = Trim(.Fields("Address") & "")                 '地址
  1545.         LrText(5) = Trim(.Fields("postcode") & "")                '邮政编码
  1546.         LrText(6) = Trim(.Fields("taxcode") & "")                 '税号
  1547.         LrText(7) = Trim(.Fields("fictperson") & "")              '法人
  1548.         LrText(8) = Trim(.Fields("bank") & "")                    '开户银行
  1549.         LrText(9) = Trim(.Fields("bankaccount") & "")             '银行账号
  1550.         LrText(10) = Trim(.Fields("cussuper") & "")               '上级主管部门
  1551.         LrText(11) = Trim(.Fields("email") & "")                  'email
  1552.         LrText(12) = Trim(.Fields("worknet"))                     '网址
  1553.         LrText(13) = Trim(.Fields("contactperson") & "")          '联系人
  1554.         LrText(14) = Trim(.Fields("contacttype") & "")            '联系方式
  1555.         LrText(15) = Trim(.Fields("desaddress") & "")             '收货地址
  1556.         
  1557.         LrText(16) = Trim(.Fields("creditgrade") & "")            '信用等级
  1558.         LrText(17) = Trim(.Fields("creditmoney") & "")            '信用额度
  1559.         LrText(18) = Trim(.Fields("creditagemoney") & "")         '帐龄额度
  1560.         LrText(19) = Trim(.Fields("creditdate") & "")             '信用天数
  1561.         
  1562.         '
  1563.         LrText(25) = Trim(.Fields("deptname") & "")               '公司分管部门名称
  1564.         LrText(26) = Trim(.Fields("Personname") & "")             '所属销售员
  1565.         LrText(27) = Format(Trim(.Fields("relationdate") & ""), "yyyy-mm-dd")  '发展日期
  1566.         
  1567.         If .Fields("stopflag") Then                               '停用标志
  1568.             ChkStopUse.Value = 1
  1569.         Else
  1570.             ChkStopUse.Value = 0
  1571.         End If
  1572.         
  1573.         str_cusname = LrText(1)
  1574.     End With
  1575. End Sub
  1576. Private Sub Scdqjl()                 '删 除 当 前 记 录
  1577.     Dim Yhanswer As Integer
  1578.     
  1579.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1580.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1581.         Exit Sub
  1582.     End If
  1583.             
  1584.     '非数据行不能删除
  1585.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1586.         Exit Sub
  1587.     End If
  1588.   
  1589.     '用户确认是否删除记录
  1590.     Tsxx = "请确认是否删除当前记录?"
  1591.     Yhanswer = Xtxxts(Tsxx, 2, 2)
  1592.     
  1593.     If Yhanswer = 2 Then
  1594.         Exit Sub
  1595.     End If
  1596.     On Error GoTo Cwcl
  1597.   
  1598.     Cw_DataEnvi.DataConnect.BeginTrans
  1599.     '[>>以下需自定义部分
  1600.     Cw_DataEnvi.DataConnect.Execute "delete Gy_Customer where CusCode = '" + Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) + "'"
  1601.     '以上为自定义部分<<]
  1602.   
  1603.     Cw_DataEnvi.DataConnect.CommitTrans
  1604.     CzxsGrid.RemoveItem CzxsGrid.Row
  1605.     Exit Sub
  1606.   
  1607. Cwcl:
  1608.     Cw_DataEnvi.DataConnect.RollbackTrans
  1609.     
  1610.     If Err.Number = -2147217873 Then                '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
  1611.         Tsxx = "此客户已经被使用,不能删除!"
  1612.         Call Xtxxts(Tsxx, 0, 1)
  1613.         Exit Sub
  1614.     Else
  1615.         Tsxx = "出现未知情况,此客户不能被删除!"
  1616.         Call Xtxxts(Tsxx, 0, 1)
  1617.         Exit Sub
  1618.     End If
  1619.     
  1620. End Sub
  1621. '*******************以下区域为编写自定义过程区域**********************
  1622. '*******************以上区域为编写自定义过程区域**********************
  1623. '******************以下为基本处理程序(固定不变)************************'
  1624. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  1625.     If Shift = 2 Then
  1626.         Select Case UCase(Chr(KeyCode))
  1627.             Case "P"                                                                          'Ctrl+P 打印
  1628.                 If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
  1629.                     Call bbyl(False)
  1630.                 End If
  1631.             Case "A"                                                                          'Ctrl+A 增加
  1632.                 '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1633.                 If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1634.                     Exit Sub
  1635.                 End If
  1636.                 If SzToolbar.Buttons("zj").Visible And SzToolbar.Buttons("zj").Enabled Then
  1637.                     Call Toolbjzt
  1638.                     Lrzt = 1
  1639.                     Call Cshlrxx(Lrzt)
  1640.                     LrText(0).Enabled = True
  1641.                     LrText(0).SetFocus
  1642.                 End If
  1643.             Case "D"                                                                          'Ctrl+D 删除
  1644.                 If SzToolbar.Buttons("sc").Visible And SzToolbar.Buttons("sc").Enabled Then
  1645.                     Call Scdqjl
  1646.                 End If
  1647.         End Select
  1648.     End If
  1649.     
  1650. End Sub
  1651. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1652.    
  1653.     Select Case Button.Key
  1654.         Case "ymsz"                                          '页面设置
  1655.             Dyymctbl.Show 1
  1656.         Case "yl"                                            '预 览
  1657.             Call bbyl(True)
  1658.         Case "dy"                                            '打 印
  1659.             Call bbyl(False)
  1660.         Case "zj"                                            '增 加
  1661.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1662.             If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1663.                 Exit Sub
  1664.             End If
  1665.             Call Toolbjzt
  1666.             Lrzt = 1
  1667.             Call Cshlrxx(Lrzt)
  1668.             
  1669.             LrText(0).Enabled = True
  1670.             LrText(0).SetFocus
  1671.         Case "xg"                                            '修 改
  1672.             Call Xgdqjl
  1673.         Case "sc"                                            '删 除
  1674.             Call Scdqjl                                      '查询
  1675.         Case "cx"
  1676.             Gy_CustomerQuery.Show 1
  1677.         Case "sx"                                            '刷 新
  1678.             Call Cxnrtcwg
  1679.         Case "bz"                                            '帮 助
  1680.             Call F1bz
  1681.         Case "fh"                                            '退 出
  1682.             Unload Me
  1683.         End Select
  1684.         
  1685. End Sub
  1686. Private Sub CzxsGrid_DblClick()                            '修改当前编码记录
  1687.     Call Xgdqjl
  1688.   
  1689. End Sub
  1690. Private Sub Xgdqjl()                                       '修改当前编码记录
  1691.     
  1692.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1693.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
  1694.         BcCommand.Enabled = False
  1695.     End If
  1696.     
  1697.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1698.         Exit Sub
  1699.     End If
  1700.     
  1701.     Call Toolbjzt
  1702.     Call mmkn
  1703.     Lrzt = 2
  1704.     
  1705.     If Cshlrxx(Lrzt) Then
  1706.         LrText(1).SetFocus
  1707.         LrText(0).Enabled = False
  1708.     End If
  1709.   
  1710. End Sub
  1711. Private Sub Toolbjzt()                                     'Toolbar状态(编辑状态)
  1712.     StTab.TabEnabled(1) = True
  1713.     StTab.Tab = 1
  1714.     Frame1.Enabled = True
  1715.     StTab.TabEnabled(0) = False
  1716.     CzxsGrid.Enabled = False
  1717.   
  1718.     With SzToolbar
  1719.         .Buttons("ymsz").Enabled = False
  1720.         .Buttons("dy").Enabled = False
  1721.         .Buttons("yl").Enabled = False
  1722.         .Buttons("zj").Enabled = False
  1723.         .Buttons("xg").Enabled = False
  1724.         .Buttons("sc").Enabled = False
  1725.         .Buttons("sx").Enabled = False
  1726.         .Buttons("cx").Enabled = False
  1727.     End With
  1728.   
  1729. End Sub
  1730. Private Sub Toolfbjzt()                                    'Toolbar状态(非编辑状态)
  1731.     StTab.TabEnabled(0) = True
  1732.     StTab.Tab = 0
  1733.     CzxsGrid.Enabled = True
  1734.     Frame1.Enabled = False
  1735.     StTab.TabEnabled(1) = False
  1736.     Lrzt = 0
  1737.     
  1738.     With SzToolbar
  1739.         .Buttons("ymsz").Enabled = True
  1740.         .Buttons("dy").Enabled = True
  1741.         .Buttons("yl").Enabled = True
  1742.         .Buttons("zj").Enabled = True
  1743.         .Buttons("xg").Enabled = True
  1744.         .Buttons("sc").Enabled = True
  1745.         .Buttons("sx").Enabled = True
  1746.         .Buttons("cx").Enabled = True
  1747.     End With
  1748.   
  1749. End Sub
  1750. Private Sub BcCommand_Click()                                           '保 存
  1751.     If Not Bclrsj Then
  1752.         Exit Sub
  1753.     End If
  1754.   
  1755.     If Lrzt = 2 Then
  1756.         Call Toolfbjzt
  1757.     End If
  1758.   
  1759. End Sub
  1760. Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)       '取消
  1761.   
  1762.     '避免执行Click程序
  1763.     Bln_Cancel = True
  1764.   
  1765.     Call Cancel
  1766.     
  1767. End Sub
  1768. Private Sub QxCommand_Click()                                                                         '取消
  1769.  
  1770.     If Bln_Cancel Then
  1771.         Bln_Cancel = False
  1772.         Exit Sub
  1773.     End If
  1774.  
  1775.     Call Cancel
  1776.     
  1777. End Sub
  1778. Private Sub Cancel()                                                                                  '取消
  1779.   
  1780.     '文本框加锁
  1781.     For jsqte = 0 To Max_Text_Index
  1782.         TextValiJudgeLock(jsqte) = True
  1783.     Next jsqte
  1784.   
  1785.     Call Toolfbjzt
  1786.     
  1787. End Sub
  1788. Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  1789.     
  1790.     FnBln_RefreshArray Col, Position, GridStr(), GridInf()
  1791. End Sub
  1792. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  1793.     
  1794.     Select Case Button.Key
  1795.         Case "bcgs"                                       '保存表格格式
  1796.             Call Bcwggs(CzxsGrid, GridCode, GridStr())
  1797.         Case "hfmrgs"                                     '恢复默认格式
  1798.             Call Hfmrgs(CzxsGrid, GridCode, GridStr())
  1799.         Case "szxsxm"                                     '设置显示项目
  1800.             Call Szxsxm(CzxsGrid, GridCode)
  1801.     End Select
  1802.     
  1803. End Sub
  1804. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1805.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1806.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1807.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1808.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1809.     ReDim Bbxbt(1 To Bbxbtgs)
  1810.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1811.     
  1812.     If Bbbwhgs <> 0 Then
  1813.         ReDim Bbbwh(1 To Bbbwhgs)
  1814.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1815.     End If
  1816.     
  1817.     Bbzbt = ReportTitle
  1818.     Bbxbt(1) = " "
  1819.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1820.     
  1821.     Call Scyxsjb(CzxsGrid)                               '生成报表数据
  1822.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1823.   
  1824.     If Not bbylte Then
  1825.         Unload DY_Tybbyldy
  1826.     End If
  1827.     
  1828. End Sub
  1829. '************以下为文本框录入处理程序(固定不变部分)*************'
  1830. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  1831.     '以下为依据实际情况自定义部分[
  1832.   
  1833.         '在此填写文本框录入事后处理程序
  1834.    
  1835.     ']以上为依据实际情况自定义部分
  1836.     
  1837. End Sub
  1838. Private Sub LrText_Change(Index As Integer)
  1839.     '屏蔽程序改变控制
  1840.     If TextChangeLock Then
  1841.         Exit Sub
  1842.     End If
  1843.     
  1844.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  1845.     
  1846.     '限制字段录入长度
  1847.           
  1848.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  1849.     Call TextChangeLimit(LrText(Index), Textint(Index, 1))  '去掉无效字符
  1850.     Select Case Textint(Index, 1)
  1851.         Case 8, 11      '金额型
  1852.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  1853.         Case 9, 12      '数量型
  1854.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  1855.         Case 10          '单价型
  1856.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1857.         Case Else        '其他小数类型控制
  1858.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  1859.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  1860.             End If
  1861.     End Select
  1862.         
  1863.     TextChangeLock = False '解锁
  1864.     
  1865. End Sub
  1866. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  1867.    
  1868.     Call TextShow(Index)
  1869.     CurTextIndex = Index
  1870.     LrText(Index).SelStart = Len(LrText(Index))
  1871.    
  1872. End Sub
  1873. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  1874.    
  1875.     Select Case KeyCode
  1876.          Case vbKeyF2
  1877.              Call Text_Help(Index)
  1878.     End Select
  1879.    
  1880. End Sub
  1881. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  1882.    
  1883.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  1884. End Sub
  1885. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  1886.     Dim RecTemp As New ADODB.Recordset
  1887.     '显示相应信息但不能进行有效性判断
  1888.     '[>>
  1889.     If Index = 0 And Lrzt = 1 Then '增加时,用户输入物料编码,显示此物料编码对应的记录
  1890.         Sqlstr = "SELECT * FROM Gy_V_Customer Where cuscode='" & Trim(LrText(0)) & "'"
  1891.         
  1892.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1893.         
  1894.         '记录如存在则读入其内容,否则提示记录已被其他人删除
  1895.         If Not RecTemp.EOF Then
  1896.             Call ShowData(RecTemp)
  1897.         End If
  1898.     End If
  1899.     '<<]
  1900. End Sub
  1901. Private Sub Timer1_Timer()
  1902.      Dim Sqlstr As String
  1903.      Timer1.Enabled = False
  1904.      Xt_Wait.Show
  1905.      Xt_Wait.Refresh
  1906.     
  1907.      '加快显示速度
  1908.      CzxsGrid.Redraw = False
  1909.     
  1910.      '生成查询结果
  1911.      Dim Str_QueryCondi As String
  1912.      Dim jsqte As Integer
  1913.     
  1914.      With Gy_CustomerQuery
  1915.          Str_QueryCondi = " where 1=1 "
  1916.          For jsqte = 0 To 4
  1917.             Select Case jsqte
  1918.               Case 0  '客户名称
  1919.                 If Trim(.LrText(0).Text) <> "" Then
  1920.                  Str_QueryCondi = Str_QueryCondi & " and cuscode='" & Trim(.LrText(0).Tag) & "'"
  1921.                 End If
  1922.               Case 1  '所属地区
  1923.                 If Trim(.LrText(1).Text) <> "" Then
  1924.                  Str_QueryCondi = Str_QueryCondi & " and areacode='" & Trim(.LrText(1).Tag) & "'"
  1925.                 End If
  1926.               Case 2   '所属行业
  1927.                  If Trim(.LrText(2).Text) <> "" Then
  1928.                     Str_QueryCondi = Str_QueryCondi & " and tradecode='" & Trim(.LrText(2).Tag) & "'"
  1929.                  End If
  1930.               Case 3    '分管部门
  1931.                 If Trim(.LrText(3).Text) <> "" Then
  1932.                     Str_QueryCondi = Str_QueryCondi & " and deptcode= '" & Trim(.LrText(3).Tag) & "'"
  1933.                 End If
  1934.               Case 4    '所属业务员
  1935.                 If Trim(.LrText(4).Text) <> "" Then
  1936.                     Str_QueryCondi = Str_QueryCondi & " and PersonCode= '" & Trim(.LrText(4).Tag) & "'"
  1937.                 End If
  1938.             End Select
  1939.     
  1940.         Next
  1941.        '查询连接串
  1942.       Sqlstr = "SELECT * from Gy_v_customer  " & Str_QueryCondi & " order by cuscode"
  1943.     
  1944.        Call Cxnrtcwg(Sqlstr)
  1945.       
  1946.      End With
  1947.    
  1948.     CzxsGrid.Redraw = True
  1949.     Xt_Wait.Hide
  1950. End Sub
  1951. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)     '按钮提供帮助
  1952.     
  1953.     Call Text_Help(Index)
  1954.     
  1955. End Sub
  1956. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  1957.   
  1958.     If Not Textboolean(Index, 1) Then
  1959.         Exit Sub
  1960.     End If
  1961.    
  1962.     '调用帮助
  1963.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  1964.   
  1965.     '根据设置选择显示编码和名称,并进行存储
  1966.     If Len(Xtfhcs) <> 0 Then
  1967.         If Textint(Index, 3) = 1 Then
  1968.             LrText(Index).Text = Xtfhcsfz
  1969.             LrText(Index).Tag = Xtfhcs
  1970.         Else
  1971.             LrText(Index).Text = Xtfhcs
  1972.             LrText(Index).Tag = Xtfhcsfz
  1973.         End If
  1974.     End If
  1975.    
  1976.     LrText(Index).SetFocus
  1977.     
  1978. End Sub
  1979. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  1980.     '填写文本框得到焦点,进行相应信息处理程序
  1981.    
  1982. End Sub
  1983. Private Sub Wbkcsh()                          '录入文本框初始化
  1984.     Dim jsqte As Integer
  1985.   
  1986.     '最大录入文本框索引值
  1987.     Max_Text_Index = Textvar(1)
  1988.   
  1989.     ReDim TextValiJudgeLock(Max_Text_Index)
  1990.     
  1991.     For jsqte = 0 To Max_Text_Index
  1992.      
  1993.         If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  1994.             If Textboolean(jsqte, 1) Then
  1995.                 If jsqte <> 0 And Not Textboolean(jsqte, 3) Then
  1996.                     Load Ydcommand1(jsqte)
  1997.                 End If
  1998.                 Ydcommand1(jsqte).Visible = True
  1999.                 Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
  2000.             End If
  2001.             TextChangeLock = True
  2002.             LrText(jsqte).Text = ""
  2003.             LrText(jsqte).Tag = ""
  2004.             
  2005.             If Textint(jsqte, 5) <> 0 Then
  2006.                 LrText(jsqte).MaxLength = Textint(jsqte, 5)
  2007.             End If
  2008.             
  2009.             TextChangeLock = False
  2010.         End If
  2011.         
  2012.         TextValiJudgeLock(jsqte) = True
  2013.     Next jsqte
  2014.     
  2015. End Sub
  2016. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  2017.     Dim Sqlstr As String
  2018.     Dim Findrec As ADODB.Recordset
  2019.   
  2020.     '文本框内容未曾改变不进行有效性判断
  2021.     If TextValiJudgeLock(Index) Then
  2022.         TextYxxpd = True
  2023.         Exit Function
  2024.     End If
  2025.   
  2026.     '文本框内容为空认为有效,并清空其Tag值
  2027.     If Trim(LrText(Index)) = "" Then
  2028.         LrText(Index).Tag = ""
  2029.         Call Wbklrwbcl(Index)
  2030.         TextValiJudgeLock(Index) = True
  2031.         TextYxxpd = True
  2032.         Exit Function
  2033.     End If
  2034.   
  2035.     '可在此加入不做有效性判断的理由
  2036.   
  2037.     Select Case Textint(Index, 4)
  2038.         Case 1      '编码型
  2039.             Sqlstr = Trim(Textstr(Index, 5))
  2040.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  2041.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  2042.          
  2043.             If Findrec.EOF Then
  2044.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  2045.                 LrText(Index).SetFocus
  2046.                 Exit Function
  2047.             Else
  2048.                 Select Case Textint(Index, 3)
  2049.                     Case 0
  2050.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  2051.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  2052.                         End If
  2053.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  2054.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  2055.                         End If
  2056.                     Case 1
  2057.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  2058.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  2059.                         End If
  2060.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  2061.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  2062.                         End If
  2063.                 End Select
  2064.             End If
  2065.             
  2066.         Case 2      '日期型
  2067.             If IsDate(LrText(Index).Text) Then
  2068.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  2069.                 If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  2070.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  2071.                 End If
  2072.             Else
  2073.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  2074.                 Call Xtxxts(Tsxx, 0, 1)
  2075.                 LrText(Index).SetFocus
  2076.                 Exit Function
  2077.             End If
  2078.             
  2079.         Case 3      '其他类型
  2080.         
  2081.     End Select
  2082.     
  2083.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  2084.     TextValiJudgeLock(Index) = True
  2085.     '调用文本框事后处理程序
  2086.     Call Wbklrwbcl(Index)
  2087.    
  2088.     '有效性判断通过则返回True
  2089.     TextYxxpd = True
  2090.    
  2091. End Function
  2092. '[<<
  2093. Private Sub Command1_Click()
  2094.     CzxsGrid.Row = CzxsGrid.FixedRows
  2095.     Call mmkn
  2096.     Lrzt = 2
  2097.     If Cshlrxx(Lrzt) Then
  2098.         LrText(1).SetFocus
  2099.         LrText(0).Enabled = False
  2100.     End If
  2101. End Sub
  2102. Private Sub Command2_Click()
  2103.     If CzxsGrid.Row = CzxsGrid.FixedRows Then
  2104.         Exit Sub
  2105.     Else
  2106.         CzxsGrid.Row = CzxsGrid.Row - 1
  2107.     End If
  2108.     Call mmkn
  2109.     Lrzt = 2
  2110.     If Cshlrxx(Lrzt) Then
  2111.         LrText(1).SetFocus
  2112.         LrText(0).Enabled = False
  2113.     End If
  2114. End Sub
  2115. Private Sub Command3_Click()
  2116.     If CzxsGrid.Row = CzxsGrid.Rows - 1 Then
  2117.         Exit Sub
  2118.     Else
  2119.         CzxsGrid.Row = CzxsGrid.Row + 1
  2120.     End If
  2121.     Call mmkn
  2122.     Lrzt = 2
  2123.     If Cshlrxx(Lrzt) Then
  2124.         LrText(1).SetFocus
  2125.         LrText(0).Enabled = False
  2126.     End If
  2127. End Sub
  2128. Private Sub Command4_Click()
  2129.     CzxsGrid.Row = CzxsGrid.Rows - 1
  2130.     Call mmkn
  2131.     Lrzt = 2
  2132.     If Cshlrxx(Lrzt) Then
  2133.         LrText(1).SetFocus
  2134.         LrText(0).Enabled = False
  2135.     End If
  2136. End Sub
  2137. Private Sub mmkn()
  2138.             If CzxsGrid.Rows = CzxsGrid.FixedRows Then
  2139.                Command1.Enabled = False    '首张
  2140.                Command2.Enabled = False     '上张
  2141.                Command3.Enabled = False     '下张
  2142.                Command4.Enabled = False     '末张
  2143.             ElseIf CzxsGrid.Rows - 1 = CzxsGrid.FixedRows Then
  2144.                Command1.Enabled = False    '首张
  2145.                Command2.Enabled = False     '上张
  2146.                Command3.Enabled = False     '下张
  2147.                Command4.Enabled = False     '末张
  2148.             ElseIf CzxsGrid.Row = CzxsGrid.Rows - 1 Then
  2149.                Command1.Enabled = True     '首张
  2150.                Command2.Enabled = True      '上张
  2151.                Command3.Enabled = False     '下张
  2152.                Command4.Enabled = False     '末张
  2153.             ElseIf CzxsGrid.Row = CzxsGrid.FixedRows Then
  2154.                Command1.Enabled = False    '首张
  2155.                Command2.Enabled = False     '上张
  2156.                Command3.Enabled = True      '下张
  2157.                Command4.Enabled = True     '末张
  2158.             ElseIf CzxsGrid.Row <> CzxsGrid.Rows - 1 And CzxsGrid.Row <> CzxsGrid.FixedRows Then
  2159.                Command1.Enabled = True   '首张
  2160.                Command2.Enabled = True     '上张
  2161.                Command3.Enabled = True     '下张
  2162.                Command4.Enabled = True     '末张
  2163.             End If
  2164. End Sub
  2165. '>>]