Function Verify_Data() Dim oForm,oElement,sID,sValue,bPass Set oForm = Form_Display_Data For Each oElement in oForm sID = oElement.id bPass = true 'If sID = "FileContent" Then oForm.enctype = "multipart/form-data" if left(sID,9) = "EditCtrl_" then sValue = oElement.value if sValue = "" then if oElement.AllowNull = "0" Then bPass = false MsgBox "'"&oElement.DataName&"'的值不允许为空.",48,"提示" exit for end if else select case oElement.DataType case "1" if oElement.Bound <> "" then aBound = Split(oElement.Bound,",",-1,1) if len(sValue) < CInt(aBound(0)) or len(sValue) > CInt(aBound(1)) then bPass = false end if case "2" if not isNumeric(sValue) then bPass = false if bPass and oElement.Bound <> "" then aBound = Split(oElement.Bound,",",-1,1) if CDbl(sValue) < CDbl(aBound(0)) or CDbl(sValue) > CDbl(aBound(1)) then bPass = false end if case "3","4" if not isdate(sValue) then bPass = false if bPass and oElement.Bound <> "" then aBound = Split(oElement.Bound,",",-1,1) if cdate(sValue) < cdate(aBound(0)) or cdate(sValue) > cdate(aBound(1)) then bPass = false end if case else end select if not bPass then MsgBox "'"&oElement.DataName&"'的值与数据类型不一致,或者此值不符合范围条件.",48,"提示" exit for end if end if end if Next Verify_Data = bPass End Function