Solved

MSChart help - damzil in distress!

Posted on 2004-04-05
10
208 Views
Last Modified: 2013-12-25
Hi guys, i have a little problem,

I have a database called 97medical.mdb.

In this database are some tables, and one in particular called "patient".

In patient table, there is a field called "gender", in which it specifies if the patient is a male or female..

What i want to know is how do i create a bar graph, showing how many male patients are on the database and how many female patients there are?

I am really really new to this, so it would be great if you could post each step by step.

Many thanks in advance you lurvley people!  (Oh what! - no smileys, o well....cheeky_galuk winks)LOL

ps,i,m using VB6.
0
Comment
Question by:cheeky_galuk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
10 Comments
 
LVL 29

Expert Comment

by:leonstryker
ID: 10759875
Take a look here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjVtChartObject.asp

Basically once you have the numbers from the database just setup the properties of the object.

Leon
0
 

Author Comment

by:cheeky_galuk
ID: 10760677
Hey there Leon,

thanks for that, but i,ve already tried MSDN, planet-source code and other various sites/books, but i really dont understand it.

That MSDN site is soo confusing.  Why dont microsoft write that sort of help in proper english so that complete newbies like me can understand it.

o well, enough ranting -

When you mean numbers from the database, how do you mean?

I thought that VB would calcualte how many patients are male and how many are female by reading it from the database.?

Thanks + looking forward to your reply...
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10761750
Create a connection to the database, setup an DAO or an ADO object and write a SQL query to return you the number of male and female patients, something like:

SELECT COUNT(gender)  FROM patient WHERE gender = 'male'
UNION
SELECT COUNT(gender)  FROM patient WHERE gender = 'female'

Now you have a recordset with the number of men and women, you can then display these values any way you need to.

Leon

0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:cheeky_galuk
ID: 10763874
Hi leonstryker,

sorry if i am asking silly questions, but i,m not that familar with VB..

how do i set a DAO/ADO object to my database?

Also, that SQL query, do i type that into the MSChart1's code page?

Once again, sorry if this questions seem silly to you, but i,m not too familar with this..

thanks
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10765200
cheeky_galuk,

You are asking at least 3 separate questions here and it seems you do not have I lot of experience with VB as well.  Is this project by change school work?

Leon
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10765522
Same question by different person:

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Databases/Q_20941092.html

You guys must be taking the same class.  ;)

Leon
0
 

Author Comment

by:cheeky_galuk
ID: 10765854
LOL, Leon, i am 38 years old and can assure you i am not at school, lol

As it is holidays here, i decided to pratice with some VB stuff, and just asking out of curiosity,

as for the the other post, i actually didnt see that on here, but similar question - i agree..
0
 
LVL 29

Accepted Solution

by:
leonstryker earned 125 total points
ID: 10765984
Well the first thing you need to know is to how to use ADO so take alook here:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=12050&lngWId=1

Leon
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

739 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