I have been asking question about graphing the number of records in a database with the same name (value in a field)for about a month or more, i have finally found a (very dodgy!)half solution, here's what i did:
adoRecordset3.Open "Select * from reportertb1 order by Name", db1, adOpenStatic, adLockOptimistic
recCount = adoRecordset3.RecordCount
For a = 1 To DistinctRecCount
If adoRecordset3.EOF Then
Exit Sub
End If
GraphData = 1
recCount = adoRecordset3.RecordCount
Do While strName = adoRecordset3!Name Or adoRecordset3.AbsolutePosition = 1
GraphData = GraphData + 1
If recCount = placeCount + 1 Then
Exit Sub
Else
adoRecordset3.MoveNext
placeCount = placeCount + 1
End If
chtSample.RowLabel = strName
Loop
chtSample.ColumnLabel = "Number of Entries"
strName = adoRecordset3!Name
i = i + 1
chtSample.DataGrid.SetData i, 1, GraphData, False
If adoRecordset3.EOF Then
chtSample.RowCount = i
Exit Sub
End If
Next a
It is very very messy code (i am still learning,hence the question) and most of it is just stuff i inveted to patch up re-occuring errors. But my problem now is how do i change the row labels so they reflect the name (value in the name field) for which the value is created, and also how do i restrict the number of columns to the number of different Names. Also do you think this code will work well...if at all? Please feel free to test it until your computer locks up with many and varied infinite loops.
Thank You all for your help, maybe one day I can answer a question, dont hold your breath though.
-David Briggs
adoRecordset3.Open "Select * from reportertb1 order by Name", db1, adOpenStatic, adLockOptimistic
recCount = adoRecordset3.RecordCount
For a = 1 To DistinctRecCount
If adoRecordset3.EOF Then
Exit Sub
End If
GraphData = 1
recCount = adoRecordset3.RecordCount
Do While strName = adoRecordset3!Name Or adoRecordset3.AbsolutePosition = 1
GraphData = GraphData + 1
If recCount = placeCount + 1 Then
Exit Sub
Else
adoRecordset3.MoveNext
placeCount = placeCount + 1
End If
chtSample.RowLabel = strName
Loop
chtSample.ColumnLabel = "Number of Entries"
strName = adoRecordset3!Name
i = i + 1
chtSample.DataGrid.SetData i, 1, GraphData, False
If adoRecordset3.EOF Then
chtSample.RowCount = i
Exit Sub
End If
Next a
It is very very messy code (i am still learning,hence the question) and most of it is just stuff i inveted to patch up re-occuring errors. But my problem now is how do i change the row labels so they reflect the name (value in the name field) for which the value is created, and also how do i restrict the number of columns to the number of different Names. Also do you think this code will work well...if at all? Please feel free to test it until your computer locks up with many and varied infinite loops.
Thank You all for your help, maybe one day I can answer a question, dont hold your breath though.
-David Briggs