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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form Query_RepSalary_Frm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "查询条件"
  5.    ClientHeight    =   2025
  6.    ClientLeft      =   2760
  7.    ClientTop       =   3750
  8.    ClientWidth     =   5580
  9.    Icon            =   "查询条件_报表.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2025
  14.    ScaleWidth      =   5580
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  '所有者中心
  17.    Begin VB.CommandButton Cmd_Cond 
  18.       Caption         =   "条件(&M)"
  19.       Height          =   300
  20.       Left            =   4350
  21.       TabIndex        =   10
  22.       Top             =   1620
  23.       Width           =   1120
  24.    End
  25.    Begin VB.CommandButton Cmd_OK 
  26.       Caption         =   "确定(&O)"
  27.       Height          =   300
  28.       Left            =   1950
  29.       TabIndex        =   6
  30.       Top             =   1620
  31.       Width           =   1120
  32.    End
  33.    Begin VB.CommandButton Cmd_Cancel 
  34.       Caption         =   "取消(&C)"
  35.       Default         =   -1  'True
  36.       Height          =   300
  37.       Left            =   3165
  38.       TabIndex        =   9
  39.       Top             =   1620
  40.       Width           =   1120
  41.    End
  42.    Begin VB.Frame Frame1 
  43.       Height          =   1470
  44.       Left            =   60
  45.       TabIndex        =   7
  46.       Top             =   60
  47.       Width           =   5370
  48.       Begin VB.CommandButton Ydcommand1 
  49.          Height          =   300
  50.          Index           =   2
  51.          Left            =   2055
  52.          Picture         =   "查询条件_报表.frx":1042
  53.          Style           =   1  'Graphical
  54.          TabIndex        =   17
  55.          Top             =   1035
  56.          Visible         =   0   'False
  57.          Width           =   300
  58.       End
  59.       Begin VB.TextBox LrText 
  60.          Height          =   300
  61.          Index           =   5
  62.          Left            =   3840
  63.          TabIndex        =   8
  64.          Text            =   "5"
  65.          Top             =   1005
  66.          Width           =   1380
  67.       End
  68.       Begin VB.TextBox LrText 
  69.          Height          =   300
  70.          Index           =   4
  71.          Left            =   3855
  72.          TabIndex        =   5
  73.          Text            =   "4"
  74.          Top             =   645
  75.          Width           =   1380
  76.       End
  77.       Begin VB.TextBox LrText 
  78.          Height          =   300
  79.          Index           =   3
  80.          Left            =   3855
  81.          TabIndex        =   3
  82.          Text            =   "3"
  83.          Top             =   210
  84.          Width           =   1080
  85.       End
  86.       Begin VB.TextBox LrText 
  87.          Height          =   300
  88.          Index           =   2
  89.          Left            =   900
  90.          TabIndex        =   2
  91.          Text            =   "2"
  92.          Top             =   1020
  93.          Width           =   1155
  94.       End
  95.       Begin VB.TextBox LrText 
  96.          Height          =   300
  97.          Index           =   0
  98.          Left            =   900
  99.          TabIndex        =   0
  100.          Text            =   "0"
  101.          Top             =   180
  102.          Width           =   1485
  103.       End
  104.       Begin VB.TextBox LrText 
  105.          Height          =   300
  106.          Index           =   1
  107.          Left            =   900
  108.          TabIndex        =   1
  109.          Text            =   "1"
  110.          Top             =   615
  111.          Width           =   1485
  112.       End
  113.       Begin VB.CommandButton Ydcommand1 
  114.          Height          =   300
  115.          Index           =   3
  116.          Left            =   4950
  117.          Picture         =   "查询条件_报表.frx":13CC
  118.          Style           =   1  'Graphical
  119.          TabIndex        =   4
  120.          TabStop         =   0   'False
  121.          Top             =   210
  122.          Visible         =   0   'False
  123.          Width           =   300
  124.       End
  125.       Begin VB.Label Lab_Note 
  126.          AutoSize        =   -1  'True
  127.          Caption         =   "会计年:"
  128.          Height          =   180
  129.          Index           =   0
  130.          Left            =   105
  131.          TabIndex        =   16
  132.          Top             =   285
  133.          Width           =   630
  134.       End
  135.       Begin VB.Label Lab_Note 
  136.          AutoSize        =   -1  'True
  137.          Caption         =   "会计期间:"
  138.          Height          =   180
  139.          Index           =   1
  140.          Left            =   105
  141.          TabIndex        =   15
  142.          Top             =   690
  143.          Width           =   810
  144.       End
  145.       Begin VB.Label Lab_Note 
  146.          AutoSize        =   -1  'True
  147.          Caption         =   "工资类别:"
  148.          Height          =   180
  149.          Index           =   2
  150.          Left            =   105
  151.          TabIndex        =   14
  152.          Top             =   1110
  153.          Width           =   810
  154.       End
  155.       Begin VB.Label Lab_Note 
  156.          AutoSize        =   -1  'True
  157.          Caption         =   "汇总依据:"
  158.          Height          =   180
  159.          Index           =   3
  160.          Left            =   2550
  161.          TabIndex        =   13
  162.          Top             =   300
  163.          Width           =   810
  164.       End
  165.       Begin VB.Label Lab_Note 
  166.          AutoSize        =   -1  'True
  167.          Caption         =   "部门开始级别:"
  168.          Height          =   180
  169.          Index           =   4
  170.          Left            =   2550
  171.          TabIndex        =   12
  172.          Top             =   705
  173.          Width           =   1170
  174.       End
  175.       Begin VB.Label Lab_Note 
  176.          AutoSize        =   -1  'True
  177.          Caption         =   "部门结束级别:"
  178.          Height          =   180
  179.          Index           =   5
  180.          Left            =   2550
  181.          TabIndex        =   11
  182.          Top             =   1110
  183.          Width           =   1170
  184.       End
  185.    End
  186. End
  187. Attribute VB_Name = "Query_RepSalary_Frm"
  188. Attribute VB_GlobalNameSpace = False
  189. Attribute VB_Creatable = False
  190. Attribute VB_PredeclaredId = True
  191. Attribute VB_Exposed = False
  192. '******************************************************************
  193. '*    模 块 名 称 :计划查询条件
  194. '*    功 能 描 述 :设置计划查询条件
  195. '*    程序员姓名  :奚俊峰
  196. '*    最后修改人  :苗鹏
  197. '*    最后修改时间:
  198. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  199. '******************************************************************
  200. Dim Tsxx As String                       '系统信息提示
  201. Public sSqlWhere As String
  202. Public sSqlWhereMe As String
  203. Public sSqlWhereMore As String
  204. Public sSqlFrom As String
  205. Public frmQuery As Form
  206. Public sRCode As String
  207. Public sPTableName As String
  208. Public bQuery As Boolean
  209. Public frmParent As Form
  210. Dim coll As New Collection
  211. '以下为固定使用变量(文本框)
  212. Dim Textvar() As Variant                 '存储变体型文本框信息
  213. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  214. Dim Textint() As Integer                 '存储整型文本框信息
  215. Dim Textstr() As String                  '存储字符型文本框信息
  216. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  217. Dim TextGroupCode As String              '文本框录入分组编码
  218. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  219. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  220. Dim CurTextIndex As Integer              '当前文本框索引值
  221. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  222. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  223. Private Sub Cmd_Cancel_Click()
  224.     Unload Me
  225. End Sub
  226. Private Sub Cmd_Cond_Click()
  227.     Dim frm As New Query_Frm
  228.     Dim s As String
  229.     Dim rs As New ADODB.Recordset
  230.     Dim i As Integer
  231.     With frm
  232.         Set .collTableName = coll
  233.         .Show 1
  234.         If .bChecked = True Then
  235.             Me.sSqlWhereMore = .sSqlWhere
  236.         End If
  237.     End With
  238.     Set rs = Nothing
  239.     Set frm = Nothing
  240. End Sub
  241. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移
  242.    Dim jdzygs As Integer                         '控件焦点转移个数
  243.    jdzygs = 30
  244.    Select Case KeyAscii
  245.       Case vbKeyReturn
  246.            If Kjjdzy(jdzygs) Then
  247.               KeyAscii = 0
  248.            End If
  249.       Case 39           '屏蔽"'"
  250.         KeyAscii = 0
  251.    End Select
  252. End Sub
  253. Private Sub Form_Load()
  254.    
  255.    '以下为文本框处理程序
  256.     TextGroupCode = "Pm_QuerySalary"
  257.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())  '读入文本框录入信息
  258.     Call Wbkcsh
  259.     Me.sSqlFrom = " From " & Me.sPTableName
  260.     Dim rs As New ADODB.Recordset
  261.     Dim s As String
  262.     s = "select Max(CodeLevel) as MaxLevel,Min(CodeLevel) as MinLevel from Gy_Department where RsPmFlag=1"
  263.     Set rs = Cw_DataEnvi.DataConnect.Execute(s)
  264.     If Not rs.EOF() Then
  265.         TextChangeLock = True
  266.         Me.LrText(4).Text = rs!MinLevel
  267.         Me.LrText(5).Text = rs!MaxLevel
  268.         TextChangeLock = False
  269.     End If
  270.     s = "select Top 1 KjYear,Period From GY_Kjrlb WHERE PMjzbz= 0 ORDER BY KjYear,Period  "
  271.     Set rs = Cw_DataEnvi.DataConnect.Execute(s)
  272.     With rs
  273.         If Not .EOF() Then
  274.             TextChangeLock = True
  275.             Me.LrText(0).Text = rs!KjYear
  276.             Me.LrText(1).Text = rs!Period
  277.             TextChangeLock = False
  278.         Else
  279.             MsgBox "当前会计日期未知", vbOKOnly + vbCritical
  280.             Exit Sub
  281.         End If
  282.     End With
  283. End Sub
  284. Private Sub Cmd_OK_Click()                                   '确 定
  285.     '录入条件有效性判断
  286.     If Not Lrtjyxxpd Then
  287.        Exit Sub
  288.     End If
  289.     
  290.         '录入条件有效性判断
  291.     If Not Lrtjyxxpd Then
  292.        Exit Sub
  293.     End If
  294.     If Trim(Me.LrText(0).Text) <> "" And IsNumeric(Me.LrText(0).Text) = False Then
  295.         MsgBox "会计年必须录入数字!", vbOKOnly + vbCritical
  296.         Exit Sub
  297.     End If
  298.     If Trim(Me.LrText(1).Text) <> "" And IsNumeric(Me.LrText(1).Text) = False Then
  299.         MsgBox "会计期间必须录入数字!", vbOKOnly + vbCritical
  300.         Exit Sub
  301.     End If
  302.     If Trim(Me.LrText(4).Text) <> "" And IsNumeric(Me.LrText(4).Text) = False Then
  303.         MsgBox "部门开始级别必须录入数字!", vbOKOnly + vbCritical
  304.         Exit Sub
  305.     End If
  306.     If Trim(Me.LrText(5).Text) <> "" And IsNumeric(Me.LrText(5).Text) = False Then
  307.         MsgBox "部门结束级别必须录入数字!", vbOKOnly + vbCritical
  308.         Exit Sub
  309.     End If
  310.     If Val(Me.LrText(4)) > Val(Me.LrText(5)) Then
  311.         MsgBox "开始级别必须小于结束级别!", vbOKOnly + vbCritical
  312.         Exit Sub
  313.     End If
  314.     Dim rs As New ADODB.Recordset
  315.     Dim s As String
  316.     s = "select Max(CodeLevel) as MaxLevel,Min(CodeLevel) as MinLevel from Gy_Department where RsPmFlag=1"
  317.     Set rs = Cw_DataEnvi.DataConnect.Execute(s)
  318.     If Not rs.EOF() Then
  319.         TextChangeLock = True
  320.         If Val(Me.LrText(4).Text) < rs!MinLevel Or Val(Me.LrText(4).Text) > rs!MaxLevel Then
  321.             Me.LrText(4).Text = rs!MinLevel
  322.         End If
  323.         If Val(Me.LrText(5).Text) > rs!MaxLevel Or Val(Me.LrText(5).Text < rs!MinLevel) Then
  324.             Me.LrText(5).Text = rs!MaxLevel
  325.         End If
  326.     Else
  327.         MsgBox "没有设置部门!", vbOKOnly + vbCritical
  328.         Exit Sub
  329.     End If
  330.     
  331.     
  332.     '生成必要的查询条件
  333.     
  334.     
  335.     s = "select distinct TableName from PM_ReportItem where RCode='" & Me.sRCode & "'"
  336.     Set rs = Cw_DataEnvi.DataConnect.Execute(s)
  337.     With rs
  338.         Do While Not .EOF()
  339.             AddTableFrom coll, Trim(!TableName & "")
  340.             .MoveNext
  341.         Loop
  342.     End With
  343.     s = GetSQLFrom(coll, Me.sPTableName)
  344.     Me.sSqlFrom = " From " & s
  345.     
  346.     s = " where 1=1 "
  347.     
  348.     With Me
  349.         '查询条件
  350.         If Me.LrText(0).Text <> "" Then
  351.             s = s & " and #.KjYear=" & Val(Me.LrText(0).Text)
  352.         End If
  353.         If Me.LrText(1).Text <> "" Then
  354.             s = s & " and #.Period=" & Val(Me.LrText(1).Text)
  355.         End If
  356.         If Me.LrText(2).Text <> "" Then
  357.             s = s & " and #.SortID='" & .LrText(2).Tag & "'"
  358.         End If
  359.         s = Replace(s, "#", Me.sPTableName)
  360.         .sSqlWhereMe = s & " and PM_PayRoll.DeptCode in (Select DeptCode from PM_OpeDept where Czybm ='" & Xtczybm & "') " & Chr(10) _
  361.                         & " and PM_PayRoll.SortID in (select SortID from PM_OpeSort where Czybm='" & Xtczybm & "') " & Chr(10)
  362.         
  363.         If Trim(.sSqlWhereMore) <> "" Then
  364.             .sSqlWhere = .sSqlWhereMe & " and " & .sSqlWhereMore
  365.         Else
  366.             .sSqlWhere = .sSqlWhereMe
  367.         End If
  368.         
  369.         .bQuery = True
  370.     End With
  371.     With frmParent
  372.         .sSqlWhere = Me.sSqlWhere
  373.         .sSqlFrom = Me.sSqlFrom
  374.         .sGroupField = Me.LrText(3).Tag
  375.         .iDeptBeginLevel = Val(Me.LrText(4).Text)
  376.         .iDeptEndLevel = Val(Me.LrText(5).Text)
  377.         frmParent.ShowRecord Me.sSqlWhere, Me.sSqlFrom
  378.     End With
  379.     Unload Me
  380.     
  381. End Sub
  382. Private Sub QxCommand_Click()                                    '取消
  383.     Me.Hide
  384. End Sub
  385. Private Function Lrtjyxxpd() As Boolean                          '用户录入条件有效性判断
  386.  Dim Jsqte As Integer
  387.  Lrtjyxxpd = False
  388.  
  389. '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
  390.   For Jsqte = 0 To Max_Text_Index
  391.     If Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2 Then
  392.       If Not TextYxxpd(Jsqte) Then
  393.          Exit Function
  394.       End If
  395.     End If
  396.   Next Jsqte
  397.    
  398.  '[>>以下为依据实际情况自定义部分
  399.  
  400.   '查询日期范围应由小到大
  401.   
  402.   
  403.  '<<]以上为依据实际情况自定义部分
  404.  
  405.  Lrtjyxxpd = True
  406. End Function
  407. '************以下为文本框录入处理程序(固定不变部分)*************'
  408. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  409.   '以下为依据实际情况自定义部分[
  410.   
  411.       '在此填写文本框录入事后处理程序
  412.    
  413.   ']以上为依据实际情况自定义部分
  414. End Sub
  415. Private Sub LrText_Change(Index As Integer)
  416.    '屏蔽程序改变控制
  417.    If TextChangeLock Then
  418.       Exit Sub
  419.    End If
  420.    
  421.    TextValiJudgeLock(Index) = False    '打开有效性判断锁
  422.     
  423.     '限制字段录入长度
  424.           
  425.      TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  426.      
  427.      Call TextChangeLimit(LrText(Index), Textint(Index, 1))  '去掉无效字符
  428.      
  429.         Select Case Textint(Index, 1)
  430.            Case 8, 11      '金额型
  431.              Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  432.            Case 9, 12      '数量型
  433.              Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  434.            Case 10          '单价型
  435.              Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  436.            Case Else        '其他小数类型控制
  437.               If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  438.                  Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  439.               End If
  440.         End Select
  441.      TextChangeLock = False '解锁
  442. End Sub
  443. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  444.    Call TextShow(Index)
  445.    CurTextIndex = Index
  446.    LrText(Index).SelStart = Len(LrText(Index))
  447. End Sub
  448. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  449.    Select Case KeyCode
  450.       Case vbKeyF2
  451.         Call Text_Help(Index)
  452.    End Select
  453. End Sub
  454. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  455.    Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  456. End Sub
  457. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点进行有效性判断及相应处理
  458.   If Textint(Index, 9) = 0 Or Textint(Index, 9) = 1 Then '事中判断
  459.      Call TextYxxpd(Index)
  460.   End If
  461. End Sub
  462. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)     '按钮提供帮助
  463.    Call Text_Help(Index)
  464. End Sub
  465. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  466.     If Not Textboolean(Index, 1) Then
  467.        Exit Sub
  468.     End If
  469.     TextValiJudgeLock(Index) = True
  470.    
  471.      '先进行有效性判断
  472.     If Not TextYxxpd(CurTextIndex) Then
  473.        Exit Sub
  474.     End If
  475.     
  476.      '[>>调入参照窗体
  477.     If Index = 3 Then
  478.         sParam = Me.sRCode
  479.     End If
  480.     If Index = 2 Then
  481.         sParam = Xtczybm
  482.     End If
  483.         
  484.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  485.      
  486.      '<<]
  487.     If Len(Xtfhcs) <> 0 Then
  488.        If Textint(Index, 3) = 1 Then
  489.           LrText(Index).Text = Xtfhcsfz
  490.           LrText(Index).Tag = Xtfhcs
  491.        Else
  492.           LrText(Index).Text = Xtfhcs
  493.           LrText(Index).Tag = Xtfhcsfz
  494.        End If
  495.     
  496.     End If
  497.    TextValiJudgeLock(Index) = False
  498.    LrText(Index).SetFocus
  499. End Sub
  500. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  501.    '填写文本框得到焦点,进行相应信息处理程序
  502.    
  503. End Sub
  504. Private Sub Wbkcsh()                          '录入文本框初始化
  505.   Dim Jsqte As Integer
  506.   
  507.   '最大录入文本框索引值
  508.   Max_Text_Index = Textvar(1)
  509.   
  510.   ReDim TextValiJudgeLock(Max_Text_Index)
  511.   For Jsqte = 0 To Max_Text_Index
  512.      
  513.      If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
  514.         If Textboolean(Jsqte, 1) Then
  515.             If Jsqte <> 0 And Not Textboolean(Jsqte, 3) Then
  516.                 Load Ydcommand1(Jsqte)
  517.             End If
  518.             Ydcommand1(Jsqte).Visible = True
  519.             Ydcommand1(Jsqte).Move LrText(Jsqte).Left + LrText(Jsqte).Width, LrText(Jsqte).Top
  520.         End If
  521.         TextChangeLock = True
  522.          LrText(Jsqte).Text = ""
  523.          LrText(Jsqte).Tag = ""
  524.          If Textint(Jsqte, 5) <> 0 Then
  525.             LrText(Jsqte).MaxLength = Textint(Jsqte, 5)
  526.          End If
  527.         TextChangeLock = False
  528.      End If
  529.      TextValiJudgeLock(Jsqte) = True
  530.   Next Jsqte
  531. End Sub
  532. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  533.   Dim Sqlstr As String
  534.   Dim Findrec As ADODB.Recordset
  535.   If TextValiJudgeLock(Index) Then    '文本框内容未曾改变不进行有效性判断
  536.      TextYxxpd = True
  537.      Exit Function
  538.   End If
  539.   If Trim(LrText(Index)) = "" Then
  540.      LrText(Index).Tag = ""
  541.      Call Wbklrwbcl(Index)
  542.      TextValiJudgeLock(Index) = True
  543.      TextYxxpd = True
  544.      Exit Function
  545.   End If
  546.        Select Case Textint(Index, 4)
  547.          Case 1      '编码型
  548.             Sqlstr = Trim(Textstr(Index, 5))
  549.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  550.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  551.             If Findrec.EOF Then
  552.                Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  553.                LrText(Index).SetFocus
  554.                Exit Function
  555.             Else
  556.                Select Case Textint(Index, 3)
  557.                  Case 0
  558.                    If Len(Trim(Textstr(Index, 2))) <> 0 Then
  559.                       LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  560.                    End If
  561.                     If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  562.                       LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  563.                    End If
  564.                  Case 1
  565.                    If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  566.                       LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  567.                    End If
  568.                     If Len(Trim(Textstr(Index, 2))) <> 0 Then
  569.                       LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  570.                    End If
  571.                End Select
  572.             End If
  573.          Case 2      '日期型
  574.             If IsDate(LrText(Index).Text) Then
  575.                LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  576.                If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  577.                   LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  578.                End If
  579.              Else
  580.                Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  581.                Call Xtxxts(Tsxx, 0, 1)
  582.                LrText(Index).SetFocus
  583.                Exit Function
  584.             End If
  585.          Case 3      '其他类型
  586.          
  587.        End Select
  588.    TextValiJudgeLock(Index) = True
  589.    TextYxxpd = True
  590. End Function