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