Solved

Graphicals charts with datapoints from MS Acess

Posted on 1999-01-22
7
351 Views
Last Modified: 2010-05-03
How do i come out with a graph chart using MSchart control from VB6 and interface this chart to MSAccess, so as to get data from access and input into the chart as datapoints?
0
Comment
Question by:yeemian
  • 3
  • 2
  • 2
7 Comments
 

Author Comment

by:yeemian
ID: 1470121
Edited text of question
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 1470122
I never find a way of giving a recordset to MSChart to produce a chart.

Here is my method:

    intX = 0
    Do until rs.eof
        With MSChart1
            .Row = intX + 1
            .Column = 1
            .Data = Val(rs.fields("Field1")
            .Column = 2
            .Data = Val(rs.Fields("Field2")
            .Column = 3
            .Data = Val(rs.Fields("Field3")
        End With
        rs.movenext
    Loop

0
 
LVL 12

Expert Comment

by:mark2150
ID: 1470123
Give up on the MSChart control and "roll your own". Is not that hard to do and you'll wind up with a form that behaves well instead of that !##%^## MSChart turd.

M

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:yeemian
ID: 1470124
thanks for the suggested answer, emoreau , but still i need to know how to interface MS access to my application ... is there any controls that enable that?
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1470125
Most controls (Text boxes, etc.) allow connection to an access database via a data control. The data control specifies the database file and primary table, the controls reference the data control and spec the fields. MSChart is stupid control and requires you to pass data to it every time the current record changes.

M

0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 1470126
I had a great surprise this morning. MS-Chart (in VB6) can now be data dound!!!

Follow these steps:
-Start a new project in VB6.
-Add the Microsoft ADO Data control 6.0 in the components.
-Add the Microsoft Chart control 6.0 in the components.
-Add a Chart to your form.
-Add a Data control to your form.
-Using the (Custom) property of your Data Control, set it to your datasource.
-Set the Datasource property of the Chart to your Data Control.
-Run the project.


0
 

Author Comment

by:yeemian
ID: 1470127
thanks alot to emoreau ! thanks for ur comment on the mschart control , mark2150!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now