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

企业管理

开发平台:

Visual Basic

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