写几个通用函数,用来判断参数是否为空,如果是数值型参数,可以进行转化如有错误进行提示.
function emptystr(byval sStr As String) as boolean
On Error GoTo err
if trim(sStr)="" then
emptystr=true
else
emptystr=false
end if
Exit Function
err:
emptystr=false
End Function
用法:
if emptystr(teststr) then messagebox("没有数据!") end if