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

企业管理

开发平台:

Visual Basic

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