Come to think of it, I don't think String arrays can store Null values in VBA anyway, so evaluating their elements for Null wouldn't make any sense. In VBA, I believe the only type of array elements you could assign Null values to would be elements of a Variant array.
Seems to me you would want to do your Null check elsewhere, i.e., when assigning values to the String array elements in the first place. Then if the value you are attempting to assign to the element is a Null, replace it with an empty string.
Code:
Sub Test()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim fld As DAO.Field
Dim intIndex As Integer
Dim astrArray(1) As String
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT * FROM Table1", dbOpenSnapshot)
intIndex = 0
With rst
.MoveLast
.MoveFirst
' If value of Field object is Null,
' place empty string in array element.
For Each fld In rst.Fields
If IsNull(fld.Value) Then
astrArray(intIndex) = ""
Else
astrArray(intIndex) = fld.Value
intIndex = intIndex + 1
End If
Next fld
End With
rst.Close: Set rst = Nothing
dbs.Close: Set dbs = Nothing
End Sub
Then you could re-write your code stub as:
Code:
If (Not bLoop And Len(strDevice(iIndex)) > 0) Then...
Might want to check your data, but I would be extremely surprised if you are actually loading any Null values at all into your array (assuming its a string array, as your code suggests).
HTH,
Bob