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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Begin VB.Form Cg_InvoiceDevQuery 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "采购发票明细表查询条件"
  6.    ClientHeight    =   4560
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   5580
  10.    HelpContextID   =   1108002
  11.    Icon            =   "采购系统_采购发票明细表查询条件.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4560
  17.    ScaleWidth      =   5580
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   1  '所有者中心
  20.    Begin VB.CommandButton QxCommand 
  21.       Caption         =   "取消(&C)"
  22.       Height          =   300
  23.       Left            =   4380
  24.       TabIndex        =   14
  25.       Top             =   4170
  26.       Width           =   1120
  27.    End
  28.    Begin VB.CommandButton QdCommand 
  29.       Caption         =   "确定(&O)"
  30.       Height          =   300
  31.       Left            =   3150
  32.       TabIndex        =   13
  33.       Top             =   4170
  34.       Width           =   1120
  35.    End
  36.    Begin VB.CommandButton Cmd_Clear 
  37.       Caption         =   "全清"
  38.       Height          =   300
  39.       Left            =   60
  40.       TabIndex        =   15
  41.       Top             =   4170
  42.       Width           =   1120
  43.    End
  44.    Begin VB.CheckBox UnloadCheck 
  45.       Caption         =   "卸载窗体"
  46.       Height          =   615
  47.       Left            =   5970
  48.       TabIndex        =   16
  49.       Top             =   1080
  50.       Width           =   825
  51.    End
  52.    Begin TabDlg.SSTab SSTab1 
  53.       Height          =   4035
  54.       Left            =   60
  55.       TabIndex        =   17
  56.       Top             =   60
  57.       Width           =   5445
  58.       _ExtentX        =   9604
  59.       _ExtentY        =   7117
  60.       _Version        =   393216
  61.       Style           =   1
  62.       Tabs            =   2
  63.       TabsPerRow      =   2
  64.       TabHeight       =   520
  65.       TabCaption(0)   =   "基本条件"
  66.       TabPicture(0)   =   "采购系统_采购发票明细表查询条件.frx":1042
  67.       Tab(0).ControlEnabled=   -1  'True
  68.       Tab(0).Control(0)=   "Frame1"
  69.       Tab(0).Control(0).Enabled=   0   'False
  70.       Tab(0).ControlCount=   1
  71.       TabCaption(1)   =   "辅助条件"
  72.       TabPicture(1)   =   "采购系统_采购发票明细表查询条件.frx":105E
  73.       Tab(1).ControlEnabled=   0   'False
  74.       Tab(1).Control(0)=   "Frame2"
  75.       Tab(1).Control(0).Enabled=   0   'False
  76.       Tab(1).ControlCount=   1
  77.       Begin VB.Frame Frame1 
  78.          Height          =   3615
  79.          Left            =   90
  80.          TabIndex        =   18
  81.          Top             =   330
  82.          Width           =   5235
  83.          Begin VB.CommandButton Ydcommand1 
  84.             Height          =   300
  85.             Index           =   0
  86.             Left            =   5550
  87.             Picture         =   "采购系统_采购发票明细表查询条件.frx":107A
  88.             Style           =   1  'Graphical
  89.             TabIndex        =   24
  90.             Top             =   3300
  91.             Visible         =   0   'False
  92.             Width           =   300
  93.          End
  94.          Begin VB.TextBox LrText 
  95.             Height          =   300
  96.             Index           =   2
  97.             Left            =   1350
  98.             TabIndex        =   2
  99.             Text            =   "2"
  100.             Top             =   1002
  101.             Width           =   3435
  102.          End
  103.          Begin VB.TextBox LrText 
  104.             Height          =   300
  105.             Index           =   0
  106.             Left            =   1350
  107.             TabIndex        =   0
  108.             Text            =   "0"
  109.             Top             =   240
  110.             Width           =   3735
  111.          End
  112.          Begin VB.TextBox LrText 
  113.             Height          =   300
  114.             Index           =   1
  115.             Left            =   1350
  116.             TabIndex        =   1
  117.             Text            =   "1"
  118.             Top             =   621
  119.             Width           =   3735
  120.          End
  121.          Begin VB.TextBox LrText 
  122.             Height          =   300
  123.             Index           =   3
  124.             Left            =   1350
  125.             TabIndex        =   3
  126.             Text            =   "3"
  127.             Top             =   1383
  128.             Width           =   3435
  129.          End
  130.          Begin VB.TextBox LrText 
  131.             Height          =   300
  132.             Index           =   4
  133.             Left            =   1350
  134.             TabIndex        =   4
  135.             Text            =   "4"
  136.             Top             =   1764
  137.             Width           =   3435
  138.          End
  139.          Begin VB.CommandButton Ydcommand1 
  140.             Height          =   300
  141.             Index           =   3
  142.             Left            =   4785
  143.             Picture         =   "采购系统_采购发票明细表查询条件.frx":1404
  144.             Style           =   1  'Graphical
  145.             TabIndex        =   23
  146.             Top             =   1383
  147.             Visible         =   0   'False
  148.             Width           =   300
  149.          End
  150.          Begin VB.CommandButton Ydcommand1 
  151.             Height          =   300
  152.             Index           =   4
  153.             Left            =   4785
  154.             Picture         =   "采购系统_采购发票明细表查询条件.frx":178E
  155.             Style           =   1  'Graphical
  156.             TabIndex        =   22
  157.             Top             =   1764
  158.             Visible         =   0   'False
  159.             Width           =   300
  160.          End
  161.          Begin VB.CommandButton Ydcommand1 
  162.             Height          =   300
  163.             Index           =   5
  164.             Left            =   2700
  165.             Picture         =   "采购系统_采购发票明细表查询条件.frx":1B18
  166.             Style           =   1  'Graphical
  167.             TabIndex        =   21
  168.             Top             =   2145
  169.             Visible         =   0   'False
  170.             Width           =   300
  171.          End
  172.          Begin VB.TextBox LrText 
  173.             Height          =   300
  174.             Index           =   5
  175.             Left            =   1350
  176.             TabIndex        =   5
  177.             Text            =   "5"
  178.             Top             =   2145
  179.             Width           =   1335
  180.          End
  181.          Begin VB.CommandButton Ydcommand1 
  182.             Height          =   300
  183.             Index           =   6
  184.             Left            =   4785
  185.             Picture         =   "采购系统_采购发票明细表查询条件.frx":1EA2
  186.             Style           =   1  'Graphical
  187.             TabIndex        =   20
  188.             Top             =   2145
  189.             Visible         =   0   'False
  190.             Width           =   300
  191.          End
  192.          Begin VB.TextBox LrText 
  193.             Height          =   300
  194.             Index           =   6
  195.             Left            =   3420
  196.             TabIndex        =   6
  197.             Text            =   "6"
  198.             Top             =   2145
  199.             Width           =   1365
  200.          End
  201.          Begin VB.CommandButton Ydcommand1 
  202.             Height          =   300
  203.             Index           =   2
  204.             Left            =   4785
  205.             Picture         =   "采购系统_采购发票明细表查询条件.frx":222C
  206.             Style           =   1  'Graphical
  207.             TabIndex        =   19
  208.             Top             =   1002
  209.             Visible         =   0   'False
  210.             Width           =   300
  211.          End
  212.          Begin VB.CommandButton Ydcommand1 
  213.             Height          =   300
  214.             Index           =   1
  215.             Left            =   6000
  216.             Picture         =   "采购系统_采购发票明细表查询条件.frx":25B6
  217.             Style           =   1  'Graphical
  218.             TabIndex        =   25
  219.             Top             =   600
  220.             Visible         =   0   'False
  221.             Width           =   300
  222.          End
  223.          Begin VB.Frame Frame3 
  224.             Height          =   405
  225.             Left            =   1350
  226.             TabIndex        =   42
  227.             Top             =   2430
  228.             Width           =   3735
  229.             Begin VB.OptionButton Opt_Fplb 
  230.                Caption         =   "全部"
  231.                Height          =   195
  232.                Index           =   0
  233.                Left            =   30
  234.                TabIndex        =   45
  235.                Top             =   150
  236.                Value           =   -1  'True
  237.                Width           =   885
  238.             End
  239.             Begin VB.OptionButton Opt_Fplb 
  240.                Caption         =   "专用"
  241.                Height          =   195
  242.                Index           =   1
  243.                Left            =   1440
  244.                TabIndex        =   44
  245.                Top             =   150
  246.                Width           =   885
  247.             End
  248.             Begin VB.OptionButton Opt_Fplb 
  249.                Caption         =   "普通"
  250.                Height          =   195
  251.                Index           =   2
  252.                Left            =   2850
  253.                TabIndex        =   43
  254.                Top             =   150
  255.                Width           =   705
  256.             End
  257.          End
  258.          Begin VB.Frame Frame4 
  259.             Height          =   405
  260.             Left            =   1350
  261.             TabIndex        =   46
  262.             Top             =   2790
  263.             Width           =   3735
  264.             Begin VB.OptionButton Opt_Djxz 
  265.                Caption         =   "全部"
  266.                Height          =   195
  267.                Index           =   0
  268.                Left            =   30
  269.                TabIndex        =   49
  270.                Top             =   150
  271.                Value           =   -1  'True
  272.                Width           =   885
  273.             End
  274.             Begin VB.OptionButton Opt_Djxz 
  275.                Caption         =   "蓝字"
  276.                Height          =   195
  277.                Index           =   1
  278.                Left            =   1440
  279.                TabIndex        =   48
  280.                Top             =   150
  281.                Width           =   885
  282.             End
  283.             Begin VB.OptionButton Opt_Djxz 
  284.                Caption         =   "红字"
  285.                Height          =   195
  286.                Index           =   2
  287.                Left            =   2850
  288.                TabIndex        =   47
  289.                Top             =   150
  290.                Width           =   765
  291.             End
  292.          End
  293.          Begin VB.Frame Frame5 
  294.             Height          =   405
  295.             Left            =   1350
  296.             TabIndex        =   50
  297.             Top             =   3150
  298.             Width           =   3735
  299.             Begin VB.OptionButton Opt_Jszt 
  300.                Caption         =   "全部"
  301.                Height          =   195
  302.                Index           =   0
  303.                Left            =   30
  304.                TabIndex        =   53
  305.                Top             =   150
  306.                Value           =   -1  'True
  307.                Width           =   885
  308.             End
  309.             Begin VB.OptionButton Opt_Jszt 
  310.                Caption         =   "已结算"
  311.                Height          =   195
  312.                Index           =   1
  313.                Left            =   1440
  314.                TabIndex        =   52
  315.                Top             =   150
  316.                Width           =   885
  317.             End
  318.             Begin VB.OptionButton Opt_Jszt 
  319.                Caption         =   "未结算"
  320.                Height          =   195
  321.                Index           =   2
  322.                Left            =   2850
  323.                TabIndex        =   51
  324.                Top             =   150
  325.                Width           =   855
  326.             End
  327.          End
  328.          Begin VB.Label Label1 
  329.             AutoSize        =   -1  'True
  330.             Caption         =   "结算状态:"
  331.             Height          =   180
  332.             Index           =   9
  333.             Left            =   120
  334.             TabIndex        =   34
  335.             Top             =   3255
  336.             Width           =   810
  337.          End
  338.          Begin VB.Label Label1 
  339.             AutoSize        =   -1  'True
  340.             Caption         =   "发票性质:"
  341.             Height          =   180
  342.             Index           =   8
  343.             Left            =   120
  344.             TabIndex        =   33
  345.             Top             =   2895
  346.             Width           =   810
  347.          End
  348.          Begin VB.Label Label1 
  349.             AutoSize        =   -1  'True
  350.             Caption         =   "发票类别:"
  351.             Height          =   180
  352.             Index           =   7
  353.             Left            =   120
  354.             TabIndex        =   32
  355.             Top             =   2535
  356.             Width           =   810
  357.          End
  358.          Begin VB.Label Label1 
  359.             AutoSize        =   -1  'True
  360.             Caption         =   "供应商:"
  361.             Height          =   180
  362.             Index           =   0
  363.             Left            =   120
  364.             TabIndex        =   31
  365.             Top             =   1065
  366.             Width           =   630
  367.          End
  368.          Begin VB.Label Label1 
  369.             AutoSize        =   -1  'True
  370.             Caption         =   "采购物料分类:"
  371.             Height          =   180
  372.             Index           =   11
  373.             Left            =   120
  374.             TabIndex        =   30
  375.             Top             =   1440
  376.             Width           =   1170
  377.          End
  378.          Begin VB.Line Line2 
  379.             Index           =   1
  380.             X1              =   3120
  381.             X2              =   3300
  382.             Y1              =   2295
  383.             Y2              =   2295
  384.          End
  385.          Begin VB.Label Label1 
  386.             AutoSize        =   -1  'True
  387.             Caption         =   "发票号:"
  388.             Height          =   180
  389.             Index           =   2
  390.             Left            =   120
  391.             TabIndex        =   29
  392.             Top             =   300
  393.             Width           =   630
  394.          End
  395.          Begin VB.Label Label1 
  396.             AutoSize        =   -1  'True
  397.             Caption         =   "物料编码:"
  398.             Height          =   180
  399.             Index           =   1
  400.             Left            =   120
  401.             TabIndex        =   28
  402.             Top             =   1830
  403.             Width           =   810
  404.          End
  405.          Begin VB.Label Label1 
  406.             AutoSize        =   -1  'True
  407.             Caption         =   "发票日期:"
  408.             Height          =   180
  409.             Index           =   3
  410.             Left            =   120
  411.             TabIndex        =   27
  412.             Top             =   2205
  413.             Width           =   810
  414.          End
  415.          Begin VB.Label Label1 
  416.             AutoSize        =   -1  'True
  417.             Caption         =   "原发票号:"
  418.             Height          =   180
  419.             Index           =   6
  420.             Left            =   120
  421.             TabIndex        =   26
  422.             Top             =   675
  423.             Width           =   810
  424.          End
  425.       End
  426.       Begin VB.Frame Frame2 
  427.          Height          =   3615
  428.          Left            =   -74910
  429.          TabIndex        =   35
  430.          Top             =   330
  431.          Width           =   5235
  432.          Begin VB.TextBox LrText 
  433.             Height          =   300
  434.             Index           =   12
  435.             Left            =   3375
  436.             TabIndex        =   12
  437.             Text            =   "12"
  438.             Top             =   1320
  439.             Width           =   1695
  440.          End
  441.          Begin VB.TextBox LrText 
  442.             Height          =   300
  443.             Index           =   11
  444.             Left            =   1290
  445.             TabIndex        =   11
  446.             Text            =   "11"
  447.             Top             =   1320
  448.             Width           =   1725
  449.          End
  450.          Begin VB.CommandButton Ydcommand1 
  451.             Height          =   300
  452.             Index           =   8
  453.             Left            =   4770
  454.             Picture         =   "采购系统_采购发票明细表查询条件.frx":2940
  455.             Style           =   1  'Graphical
  456.             TabIndex        =   41
  457.             Top             =   600
  458.             Visible         =   0   'False
  459.             Width           =   300
  460.          End
  461.          Begin VB.CommandButton Ydcommand1 
  462.             Height          =   300
  463.             Index           =   7
  464.             Left            =   4770
  465.             Picture         =   "采购系统_采购发票明细表查询条件.frx":2CCA
  466.             Style           =   1  'Graphical
  467.             TabIndex        =   40
  468.             Top             =   240
  469.             Visible         =   0   'False
  470.             Width           =   300
  471.          End
  472.          Begin VB.TextBox LrText 
  473.             Height          =   300
  474.             Index           =   7
  475.             Left            =   1290
  476.             TabIndex        =   7
  477.             Text            =   "7"
  478.             Top             =   240
  479.             Width           =   3495
  480.          End
  481.          Begin VB.TextBox LrText 
  482.             Height          =   300
  483.             Index           =   8
  484.             Left            =   1290
  485.             TabIndex        =   8
  486.             Text            =   "8"
  487.             Top             =   600
  488.             Width           =   3495
  489.          End
  490.          Begin VB.TextBox LrText 
  491.             Height          =   300
  492.             Index           =   9
  493.             Left            =   1290
  494.             TabIndex        =   9
  495.             Text            =   "9"
  496.             Top             =   960
  497.             Width           =   1725
  498.          End
  499.          Begin VB.TextBox LrText 
  500.             Height          =   300
  501.             Index           =   10
  502.             Left            =   3375
  503.             TabIndex        =   10
  504.             Text            =   "10"
  505.             Top             =   960
  506.             Width           =   1695
  507.          End
  508.          Begin VB.Line Line2 
  509.             Index           =   2
  510.             X1              =   3090
  511.             X2              =   3300
  512.             Y1              =   1470
  513.             Y2              =   1470
  514.          End
  515.          Begin VB.Label Label1 
  516.             AutoSize        =   -1  'True
  517.             Caption         =   "业务员:"
  518.             Height          =   180
  519.             Index           =   12
  520.             Left            =   120
  521.             TabIndex        =   39
  522.             Top             =   660
  523.             Width           =   630
  524.          End
  525.          Begin VB.Label Label1 
  526.             AutoSize        =   -1  'True
  527.             Caption         =   "部门:"
  528.             Height          =   180
  529.             Index           =   10
  530.             Left            =   120
  531.             TabIndex        =   38
  532.             Top             =   300
  533.             Width           =   450
  534.          End
  535.          Begin VB.Label Label1 
  536.             AutoSize        =   -1  'True
  537.             Caption         =   "数量:"
  538.             Height          =   180
  539.             Index           =   4
  540.             Left            =   150
  541.             TabIndex        =   37
  542.             Top             =   1020
  543.             Width           =   450
  544.          End
  545.          Begin VB.Label Label1 
  546.             AutoSize        =   -1  'True
  547.             Caption         =   "金额:"
  548.             Height          =   180
  549.             Index           =   5
  550.             Left            =   150
  551.             TabIndex        =   36
  552.             Top             =   1380
  553.             Width           =   450
  554.          End
  555.          Begin VB.Line Line2 
  556.             Index           =   0
  557.             X1              =   3090
  558.             X2              =   3300
  559.             Y1              =   1110
  560.             Y2              =   1110
  561.          End
  562.       End
  563.    End
  564. End
  565. Attribute VB_Name = "Cg_InvoiceDevQuery"
  566. Attribute VB_GlobalNameSpace = False
  567. Attribute VB_Creatable = False
  568. Attribute VB_PredeclaredId = True
  569. Attribute VB_Exposed = False
  570. '******************************************************************
  571. '*    模 块 名 称 :采购发票明细表查询条件
  572. '*    功 能 描 述 :
  573. '*    程序员姓名  :李海祥
  574. '*    最后修改人  :李海祥
  575. '*    最后修改时间:2001/09/20
  576. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  577. '******************************************************************
  578. Dim Tsxx As String                       '系统信息提示
  579. '以下为固定使用变量(文本框)
  580. Dim Textvar() As Variant                 '存储变体型文本框信息
  581. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  582. Dim Textint() As Integer                 '存储整型文本框信息
  583. Dim Textstr() As String                  '存储字符型文本框信息
  584. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  585. Dim TextGroupCode As String              '文本框录入分组编码
  586. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  587. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  588. Dim CurTextIndex As Integer              '当前文本框索引值
  589. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  590. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  591. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移(Fixed)
  592.     Dim jdzygs As Integer                         '控件焦点转移个数
  593.     jdzygs = 30
  594.     Select Case KeyAscii
  595.         Case vbKeyReturn
  596.             If Kjjdzy(jdzygs) Then
  597.                 KeyAscii = 0
  598.             End If
  599.         Case 39           '屏蔽"'"
  600.             KeyAscii = 0
  601.     End Select
  602. End Sub
  603. Private Sub Form_Load()
  604.    
  605.     '以下为文本框处理程序(Fixed)
  606.     TextGroupCode = "Cg_InvoiceDevQuery"
  607.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())  '读入文本框录入信息
  608.     Call Wbkcsh
  609.    
  610.     '[>>初始化查询条件默认值
  611.     LrText(5).Text = Format(Xtrq, "yyyy-mm-dd")
  612.     LrText(6).Text = Format(Xtrq, "yyyy-mm-dd")
  613.     '<<]
  614.    
  615. End Sub
  616. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)          '查询条件窗体卸载
  617.     '查询条件窗体卸载时判断是否因为结果窗体卸载,如是则卸载,否则隐藏
  618.     If UnloadCheck.Value <> 1 Then
  619.         Cancel = 1
  620.         Me.Hide
  621.     End If
  622.     
  623. End Sub
  624. Private Sub QdCommand_Click()                                   '确 定
  625.     '录入条件有效性判断(Fixed)
  626.     If Not Lrtjyxxpd Then
  627.         Exit Sub
  628.     End If
  629.     Me.Hide
  630.         
  631.     '[>>激活查询过程结果窗体
  632.     
  633.     Cg_InvoiceDevList.Timer1.Enabled = True
  634.     Cg_InvoiceDevList.SetFocus
  635.     
  636.     '<<]
  637. End Sub
  638. Private Sub QxCommand_Click()                                    '取消(Fixed)
  639.     Me.Hide
  640. End Sub
  641. Private Function Lrtjyxxpd() As Boolean                          '用户录入条件有效性判断
  642.     Dim jsqte As Integer
  643.     Lrtjyxxpd = False
  644.  
  645.     '对需要进行事后判断的文本框录入内容进行有效性判断 (Fixed)
  646.     For jsqte = 0 To Max_Text_Index
  647.         If Textint(jsqte, 9) = 0 Or Textint(jsqte, 9) = 2 Then
  648.             If Not TextYxxpd(jsqte) Then
  649.                  Call TextShow(jsqte)
  650.                  Exit Function
  651.             End If
  652.         End If
  653.     Next jsqte
  654.    
  655.     '[>>以下为依据实际情况自定义部分
  656.  
  657.     '查询日期范围应由小到大
  658.     If LrText(5).Text > LrText(6).Text And Trim(LrText(6).Text) <> "" Then
  659.         Tsxx = "查询发票日期范围应由小到大!"
  660.         Call Xtxxts(Tsxx, 0, 4)
  661.         LrText(5).SetFocus
  662.         Exit Function
  663.     End If
  664.     If S2N(LrText(9).Text) > S2N(LrText(10).Text) And Trim(LrText(10).Text) <> "" Then
  665.         Tsxx = "查询数量范围应由小到大!"
  666.         Call Xtxxts(Tsxx, 0, 4)
  667.         LrText(9).SetFocus
  668.         Exit Function
  669.     End If
  670.     If S2N(LrText(11).Text) > S2N(LrText(12).Text) And Trim(LrText(12).Text) <> "" Then
  671.         Tsxx = "查询金额范围应由小到大!"
  672.         Call Xtxxts(Tsxx, 0, 4)
  673.         LrText(11).SetFocus
  674.         Exit Function
  675.     End If
  676.     '<<]以上为依据实际情况自定义部分
  677.  
  678.     Lrtjyxxpd = True
  679. End Function
  680. Private Sub Cmd_Clear_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)    '将用户输入条件全部清除(可选)
  681.     '清除文本框(Fixed)
  682.     For jsqte = 0 To Max_Text_Index
  683.         LrText(jsqte).Tag = ""
  684.         LrText(jsqte).Text = ""
  685.     Next jsqte
  686.     Me.Opt_Fplb(0).Value = True
  687.     Me.Opt_Djxz(0).Value = True
  688.     Me.Opt_Jszt(0).Value = True
  689.     '[>>
  690.     '此处可以写入其他清除条件程序
  691.     '<<]
  692.   
  693. End Sub
  694. '*************以下为文本框录入处理程序(固定不变部分)*************'
  695. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  696.   
  697.     '以下为依据实际情况自定义部分[
  698.     '在此填写文本框录入事后处理程序
  699.     ']以上为依据实际情况自定义部分
  700.   
  701. End Sub
  702. Private Sub LrText_Change(Index As Integer)
  703.    
  704.     '屏蔽程序改变控制
  705.     If TextChangeLock Then
  706.         Exit Sub
  707.     End If
  708.     
  709.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  710.     
  711.     '限制字段录入长度
  712.           
  713.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  714.     Call TextChangeLimit(LrText(Index), Textint(Index, 1))  '去掉无效字符
  715.     Select Case Textint(Index, 1)
  716.         Case 8, 11      '金额型
  717.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  718.         Case 9, 12      '数量型
  719.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  720.         Case 10          '单价型
  721.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  722.         Case Else        '其他小数类型控制
  723.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  724.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  725.             End If
  726.     End Select
  727.         
  728.     TextChangeLock = False '解锁
  729. End Sub
  730. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  731.     Call TextShow(Index)
  732.     CurTextIndex = Index
  733.     LrText(Index).SelStart = Len(LrText(Index))
  734. End Sub
  735. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  736.     
  737.     Select Case KeyCode
  738.         Case vbKeyF2
  739.             Call Text_Help(Index)
  740.     End Select
  741. End Sub
  742. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  743.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  744. End Sub
  745. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  746.     '显示相应信息但不能进行有效性判断
  747.   
  748. End Sub
  749. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)     '按钮提供帮助
  750.     Call Text_Help(Index)
  751. End Sub
  752. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  753.     If Not Textboolean(Index, 1) Then
  754.         Exit Sub
  755.     End If
  756.      
  757.     '调用帮助
  758.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  759.   
  760.     '根据设置选择显示编码和名称,并进行存储
  761.     If Len(Xtfhcs) <> 0 Then
  762.         If Textint(Index, 3) = 1 Then
  763.             LrText(Index).Text = Xtfhcsfz
  764.             LrText(Index).Tag = Xtfhcs
  765.         Else
  766.             LrText(Index).Text = Xtfhcs
  767.             LrText(Index).Tag = Xtfhcsfz
  768.         End If
  769.     End If
  770.    
  771.     LrText(Index).SetFocus
  772. End Sub
  773. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  774.     '填写文本框得到焦点,进行相应信息处理程序
  775.    
  776. End Sub
  777. Private Sub Wbkcsh()                          '录入文本框初始化
  778.     
  779.     Dim jsqte As Integer
  780.   
  781.     '最大录入文本框索引值
  782.     Max_Text_Index = Textvar(1)
  783.   
  784.     ReDim TextValiJudgeLock(Max_Text_Index)
  785.     For jsqte = 0 To Max_Text_Index
  786.         If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  787.             If Textboolean(jsqte, 1) Then
  788.                 If jsqte <> 0 And Not Textboolean(jsqte, 3) Then
  789.                     Load Ydcommand1(jsqte)
  790.                 End If
  791.                 Ydcommand1(jsqte).Visible = True
  792.                 Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
  793.             End If
  794.             TextChangeLock = True
  795.             LrText(jsqte).Text = ""
  796.             LrText(jsqte).Tag = ""
  797.             If Textint(jsqte, 5) <> 0 Then
  798.                 LrText(jsqte).MaxLength = Textint(jsqte, 5)
  799.             End If
  800.             TextChangeLock = False
  801.         End If
  802.         TextValiJudgeLock(jsqte) = True
  803.     Next jsqte
  804. End Sub
  805. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  806.     
  807.     Dim Sqlstr As String
  808.     Dim Findrec As ADODB.Recordset
  809.   
  810.     '文本框内容未曾改变不进行有效性判断
  811.     If TextValiJudgeLock(Index) Then
  812.         TextYxxpd = True
  813.         Exit Function
  814.     End If
  815.   
  816.     '文本框内容为空认为有效,并清空其Tag值
  817.     If Trim(LrText(Index)) = "" Then
  818.         LrText(Index).Tag = ""
  819.         Call Wbklrwbcl(Index)
  820.         TextValiJudgeLock(Index) = True
  821.         TextYxxpd = True
  822.         Exit Function
  823.     End If
  824.   
  825.     '可在此加入不做有效性判断的理由
  826.   
  827.     Select Case Textint(Index, 4)
  828.         Case 1      '编码型
  829.             Sqlstr = Trim(Textstr(Index, 5))
  830.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  831.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  832.             If Findrec.EOF Then
  833.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  834.                 LrText(Index).SetFocus
  835.                 Exit Function
  836.             Else
  837.                 Select Case Textint(Index, 3)
  838.                     Case 0
  839.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  840.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  841.                         End If
  842.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  843.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  844.                         End If
  845.                     Case 1
  846.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  847.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  848.                         End If
  849.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  850.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  851.                         End If
  852.                 End Select
  853.             End If
  854.         Case 2      '日期型
  855.             If IsDate(LrText(Index).Text) Then
  856.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  857.                 If S2N(Mid(LrText(Index), 1, 4)) < 1900 Then
  858.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  859.                 End If
  860.             Else
  861.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  862.                 Call Xtxxts(Tsxx, 0, 1)
  863.                 LrText(Index).SetFocus
  864.                 Exit Function
  865.             End If
  866.         Case 3      '其他类型
  867.     End Select
  868.     
  869.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  870.     TextValiJudgeLock(Index) = True
  871.     '调用文本框事后处理程序
  872.     Call Wbklrwbcl(Index)
  873.    
  874.     '有效性判断通过则返回True
  875.     TextYxxpd = True
  876.    
  877. End Function