D
ducky801
Hi all. When i run the code below i get a 'NullReferenceException was
unhandled' error. I am using VB 2005 Express.
I'm confused about this because, I have declared my array and i'm
trying to put things in it, so shouldn't it BE NULL until i start to
put things in it? I'm kind of new to this so hoepfully i'm just
overlooking something easy. I know my code is actually talking to the
DB (or dataset rather) because the messageboxes work. if i pull out
the buggy line, it will messagebox every login id in the table. Any
help that anybody can offer is greatly appreciated:
Module DynamicACSAuto
Public ArrLoginIDs() As Integer 'arra. holds phone logins. used
by createTBL()
___________________________________________________________________________
Sub GetLoginIDs()
'this procedure makes the program query the empdata table in
the empdb. it is used to put
'the login ID of each agent into an array, which will then be
iterated through to create
'the dynamic TBL reports in the CreateTBL routine
Dim RowCount As Integer 'holds number of records in the dataset
Dim Count As Integer
RowCount = Form1.EmpDBDataSet.Tables("Empdata").Rows.Count
Count = 1
Do Until Count = RowCount
MsgBox(Form1.EmpDBDataSet.Tables("empdata").Rows(Count).Item("phonelogin"))
'CODE BUGS AT NEXT LINE. ##########################
ArrLoginIDs(Count - 1) =
Form1.EmpDBDataSet.Tables("empdata").Rows
'BUGGY LINE ABOVE ################################
(Count).Item("phonelogin")
Count = Count + 1
Loop
MsgBox(ArrLoginIDs)
MsgBox(Count)
End Sub
unhandled' error. I am using VB 2005 Express.
I'm confused about this because, I have declared my array and i'm
trying to put things in it, so shouldn't it BE NULL until i start to
put things in it? I'm kind of new to this so hoepfully i'm just
overlooking something easy. I know my code is actually talking to the
DB (or dataset rather) because the messageboxes work. if i pull out
the buggy line, it will messagebox every login id in the table. Any
help that anybody can offer is greatly appreciated:
Module DynamicACSAuto
Public ArrLoginIDs() As Integer 'arra. holds phone logins. used
by createTBL()
___________________________________________________________________________
Sub GetLoginIDs()
'this procedure makes the program query the empdata table in
the empdb. it is used to put
'the login ID of each agent into an array, which will then be
iterated through to create
'the dynamic TBL reports in the CreateTBL routine
Dim RowCount As Integer 'holds number of records in the dataset
Dim Count As Integer
RowCount = Form1.EmpDBDataSet.Tables("Empdata").Rows.Count
Count = 1
Do Until Count = RowCount
MsgBox(Form1.EmpDBDataSet.Tables("empdata").Rows(Count).Item("phonelogin"))
'CODE BUGS AT NEXT LINE. ##########################
ArrLoginIDs(Count - 1) =
Form1.EmpDBDataSet.Tables("empdata").Rows
'BUGGY LINE ABOVE ################################
(Count).Item("phonelogin")
Count = Count + 1
Loop
MsgBox(ArrLoginIDs)
MsgBox(Count)
End Sub