'**********判断text中是否为空,或者判断其中是否允许输入数字或字符
    Public Function bTxtFmat(ByVal strTxt As String, ByVal iTxtType As Integer, ByVal bNullAllow As Boolean, ByVal strCaption As String) As Boolean
        'txt=text.text
        'txttype=1,2,3(1=数字型,2=字符型,3=汉字,4=数字和字符)
        'nullallow=是否允许为空,true=可以为空。
        'caption=显示文本框内容的标题
        Dim i, k, m As Integer
        If bNullAllow = False Then
            If Len(strTxt) = 0 Then
                MsgBox("" & strCaption & "输入项中内容不允许为空,请重新输入!", MsgBoxStyle.Exclamation, "系统警告")
                bTxtFmat = False
                Exit Function
            End If
        End If
        k = Len(strTxt)
        Select Case iTxtType
            Case 1
                For i = 1 To k
                    m = Asc(Right(Left(strTxt, i), 1))
                    If m < 48 Or m > 57 Then
                        MsgBox("" & strCaption & "输入项中只允许输入数字", MsgBoxStyle.Exclamation, "系统警告")
                        bTxtFmat = False
                        Exit Function
                    End If
                Next
            Case 2
                For i = 1 To k
                    m = Asc(Right(Left(strTxt, i), 1))
                    If m < 65 Or (m > 91 And m < 97) Or m > 123 Then
                        MsgBox("" & strCaption & "输入项中只允许输入字符", MsgBoxStyle.Exclamation, "系统警告")
                        bTxtFmat = False
                        Exit Function
                    End If
                Next
            Case 3
                For i = 1 To k
                    m = Asc(Right(Left(strTxt, i), 1))
                    If m >= 0 Then '汉字首位为1,按有符号计算全部为负数
                        MsgBox("" & strCaption & "输入项中只允许输入汉字!", MsgBoxStyle.Exclamation, "系统警告")
                        bTxtFmat = False
                        Exit Function
                    End If
                Next
            Case 4
                For i = 1 To k
                    m = Asc(Right(Left(strTxt, i), 1))
                    If m < 0 Then '汉字首位为1,按有符号计算全部为负数
                        MsgBox("" & strCaption & "输入项中不允许输入汉字!", MsgBoxStyle.Exclamation, "系统警告")
                        bTxtFmat = False
                        Exit Function
                    End If
                Next
        End Select
        bTxtFmat = True
    End Function