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

企业管理

开发平台:

Visual Basic

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