I cannot figure out why IsEmpty is not working. Can someone explain to me why blTest returns True instead of False
Sub TestEmpty()
Dim strTest As String
Dim blTest As Boolean
strTest = Empty
blTest = Not (IsEmpty(strTest))
End Sub
I cannot figure out why IsEmpty is not working. Can someone explain to me why blTest returns True instead of False
Sub TestEmpty()
Dim strTest As String
Dim blTest As Boolean
strTest = Empty
blTest = Not (IsEmpty(strTest))
End Sub
A quick google search finds this:
https://support.office.com/en-us/art...6-A69A42E55E50
where you will note that isempty is only meaningful for Variants. If you change your little test to Dim strTest as Variant, you get what you expect.
I seem to remember that Empty refers to a Variant DataType...try changing
Dim strTest As String
to
Dim strTest As Variant
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007
For a string, you can use
Code:If len(strTest & vbnullstring) > 0 then blTest = true else blTest = false End If