StealthRT
09-02-2009, 07:20 PM
Hey all, i am having problems with trying to figure out how to go about fixing this string up for an array.
This code works just fine:
TitleArray = Array("test1", "test2", "test3", "test4", "test5", "test6")
DataArray = Array(34, 53, 12, 18, 55, 2)
NumOfItems = UBound(TitleArray) + 1
However, once i convert that test stuff to what i am accually going to be using (data from my database), it seems to not work out at all. It only shows one value on the chart instead.
Public TitleArray As Variant
Public DataArray As Variant
Public NumOfItems As Integer
Dim tempTitleArray As String
Dim tempDataArray As String
Dim recCount As Integer
Do Until .EOF
If x <> recCount Then
tempTitleArray = """" & !itemName & """" & "," & tempTitleArray
tempDataArray = !itemPriceTotal & "," & tempDataArray
Else
tempTitleArray = tempTitleArray & """" & !itemName & """"
tempDataArray = tempDataArray & !itemPriceTotal
End If
x = x + 1
.MoveNext
Loop
TitleArray = Split(tempTitleArray, ",")
DataArray = Split(tempDataArray, ",")
NumOfItems = UBound(TitleArray) + 1
I have also tried:
TitleArray = Array(tempTitleArray)
DataArray = Array(tempDataArray)
But i still get only one value... What is it that i am doing wrong?? :confused:
Thanks for your time,
David
This code works just fine:
TitleArray = Array("test1", "test2", "test3", "test4", "test5", "test6")
DataArray = Array(34, 53, 12, 18, 55, 2)
NumOfItems = UBound(TitleArray) + 1
However, once i convert that test stuff to what i am accually going to be using (data from my database), it seems to not work out at all. It only shows one value on the chart instead.
Public TitleArray As Variant
Public DataArray As Variant
Public NumOfItems As Integer
Dim tempTitleArray As String
Dim tempDataArray As String
Dim recCount As Integer
Do Until .EOF
If x <> recCount Then
tempTitleArray = """" & !itemName & """" & "," & tempTitleArray
tempDataArray = !itemPriceTotal & "," & tempDataArray
Else
tempTitleArray = tempTitleArray & """" & !itemName & """"
tempDataArray = tempDataArray & !itemPriceTotal
End If
x = x + 1
.MoveNext
Loop
TitleArray = Split(tempTitleArray, ",")
DataArray = Split(tempDataArray, ",")
NumOfItems = UBound(TitleArray) + 1
I have also tried:
TitleArray = Array(tempTitleArray)
DataArray = Array(tempDataArray)
But i still get only one value... What is it that i am doing wrong?? :confused:
Thanks for your time,
David