By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,827 Members | 2,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,827 IT Pros & Developers. It's quick & easy.

Access Results in a Chart

P: 6
Hi!
I decided to try this Microsoft Charts Control. I couldn't decide what type of program to write and at last I started writting a program, where you put your jump results. This is the same exercise as in the classes of PE. Well, I wrote the part where I show the results through FlexGrid. But I have a problem... My chart's first row and my chart's last row are SAME! If there are 7 records in the database, the first row is R7 and the last row is also R7. My code is written below.

Expand|Select|Wrap|Line Numbers
  1. Data1.DatabaseName = App.Path & "\jumps.mdb"
  2. Data1.RecordSource = "jumps"
  3. Data1.Refresh
  4.  
  5.  Dim rs As New ADODB.Recordset, sql As String
  6.    sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\jumps.mdb;"
  7.    sql = "SELECT COUNT(*) FROM jumps;"
  8.    rs.CursorLocation = adUseClient
  9.    rs.Open sql, sConn, adOpenKeyset, adLockPessimistic, adCmdText
  10.    rs.MoveLast
  11.  
  12.    maxi = rs.Fields(0).Value
  13.  
  14.     rs.Close
  15.  
  16.    Set rs = Nothing
  17.  
  18. Text1.Text = maxi
  19.  
  20.  
  21. MSChart1.RowCount = maxi
  22.  
  23. For I = 1 To maxi
  24.  
  25.  
  26. MSChart1.RowLabel = "R" & I
  27.  
  28.  
  29. MSChart1.Data = MSFlexGrid1.TextMatrix(I, 2)
  30. MSFlexGrid1.TextMatrix(I, 0) = I
  31.  
  32. Next I
  33.  
Apr 17 '07 #1
Share this Question
Share on Google+
1 Reply


P: 6
I can't agree that no one knows...
Apr 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.