C
Craig
I have the following code (below)...i have been trying to
use a dynamic array. However, it gets down to that
first 'if' statement and then at the line 'TheArray(n) =
tbl1(0)' it gives an error that says 'Subscript out of
range'
Can anyone tell me what i'm doing wrong? Thank you for
any help!!!
Craig
Dim TheArray() As String
Dim n As Integer
Dim tbl1 As DAO.Recordset
Dim db As DAO.Database
n = 0 'initialize value of n to 0
Set db = CurrentDb
Set tbl1 = db.OpenRecordset("Criags List", dbOpenDynaset)
If IsNull(tbl1(0)) Then
tbl1.MoveNext
Else
TheArray(n) = tbl1(0)
n = (n + 1)
TheArray(n) = tbl1(2)
End If
use a dynamic array. However, it gets down to that
first 'if' statement and then at the line 'TheArray(n) =
tbl1(0)' it gives an error that says 'Subscript out of
range'
Can anyone tell me what i'm doing wrong? Thank you for
any help!!!
Craig
Dim TheArray() As String
Dim n As Integer
Dim tbl1 As DAO.Recordset
Dim db As DAO.Database
n = 0 'initialize value of n to 0
Set db = CurrentDb
Set tbl1 = db.OpenRecordset("Criags List", dbOpenDynaset)
If IsNull(tbl1(0)) Then
tbl1.MoveNext
Else
TheArray(n) = tbl1(0)
n = (n + 1)
TheArray(n) = tbl1(2)
End If