
x/y graphing and links to MS-Word documents from Access DB
Quote:
> Issue #1
> ------------
> My attempt is to pull a series of numeric values from an Access 97 database
> and then plot these on an x/y graph. My question is regardless of the math,
> through what Windows, VB, or other tool do I draw the graph on a VB form?
Here's a simple method to draw an x-y graph on a form. To see it
work, add a blank form to a project, put a command button on it, and
paste this code to that button's click event.
You'll see that the procedure could be written as a loop to increment
the number of the cmdObj for each iteration and draw another segment of
the graph. The X1, Y1 of each new cmdObj equals the X2, Y2 of the
preceding cmdObj.
The measurement units are twips, so you'll need to add a procedure to
convert your data values to twip values, relative to the range of
numbers you're graphing vs. the size of your form.
Me.Controls.Add "VB.Line", "cmdObj1"
With Me!cmdObj1
'.Visible = True
.X1 = 500
.X2 = 2500
.Y1 = 1500
.Y2 = 2500
End With
Me.Controls.Add "VB.Line", "cmdObj2"
With Me!cmdObj2
.Visible = True
.X1 = 2500
.X2 = 3500
.Y1 = 2500
.Y2 = 1500
End With
Of course, if you want something with all the bells & whistles, you can
pay $399 for Olectra Chart at http://www.klg.com
Quote:
> Issue #2
> -----------
> I also need to display on a form textual data from an Access database. The
> text is topically associated with excerpts from Word documents. Along with
> the text on the form I need to display links to the exact lines in the Word
> document which will cause Microsoft Word to open up the document at the
> proper location with the text highlighted. I understand that this possible.
> How are the links used in VB to open up WORD?
This is a cool project, but more involved than a quick e-mail answer!
In your Word documents, you can set Bookmarks to mark each location.
Then you'll have to save those Bookmarks with the excerpts in your db -
Word Bookmarks can be displayed as hyperlinks that will open the
associated document at the specified Bookmark location. I haven't tried
this to know if the user could just click the hyperlink in a field on
your VB app form to open Word. For other processes, I have opened Word
via VB code, which is extra work for you to program.
As to highlighting certain text when you get to the Word doc, you're
on your own.
For someone "relatively new to VB programming", you are very
ambitious! If you have more questions on this, lemme know; if it's
something I can answer easily, I will. Good luck - it sounds like a fun
project.
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"
"What's so funny 'bout peace, love & understanding?"
- Nick Lowe