Challenge: Drawing in Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is it possible to write some code to draw something in Access. Example as
follows:

Suppose I have the following values stored in a table
x value y value
1 3
1 6
4 3
4 6
Plotting these points and using line to join the points will hopefully
result in a shape of some short. Is this beyond the realms of Access>
Is there a form control, activex control that i could use?

Thanks
 
One way would be to pre-create a sufficient number of Line controls, on
a form. Call those controls L1, L2, L3 & so on. Then you could make
each control visible (or invisible), and set their end-points, through
code:

' to make line L1 visible (or invisible):
me![L1].visible = true (or false)

' to set the endpoints of line L1:
with me![L1]
.top = ...
.left = ...
.width = ...
.height = ...
end with

Look up all those properties in F1 help.

You'd need fairly good coding skills to get this working properly.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
You could use the Line method exposed by the vbPictureBox class here:
http://www.lebans.com/imageclass.htm
ImageClass has been replaced by the PictureBoxA97 project. A standard Image
control is wrapped within a class to allow the control to resemble the
standard Visual Basic PictureBox control. Simple drawing methods are
directly supported as is Text output with rotation. A handle to a Device
Context is exposed to allow the developer to use the full range of Graphic
API's. Also supports Screen Grabs, Copy to Clipboard and Save Image control
to a disk Bitmap file. Here is the Access 2000 version, PictureBoxA2K.zip
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Take a look at MetaDraw

MetaDraw is an enhanced image control that will allow you
to dynamically draw either by code, or if you want you can
also allow end-users to draw ( totally under your control
of course ). The drawing can be zoomed, scrolled,
saved ( to file or database field ) and reloaded,
printed, copied to the clipboard ....
You can also allow end-users to click on portions of the
drawing and then process events based on what they
have clicked on. ( for instance for a plot you might give
some additional information about specific plot lines )

For general information on MetaDraw see
www.Bennet-Tec.com/btproducts/MetaDraw/MetaDraw.htm

For note specific to compatibility of MetaDraw in MS Access
see
http://www.bennet-tec.com/compatibility.htm#Access

Best wishes on the project

* * Please include a copy of this message with your reply

Jeff Bennett
(e-mail address removed)

* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com

=================== ===================
 
Now *there's* an interesting turn of phrase! What's it mean?

Genuinely curious,

It's a nautical phrase: sailing close to the wind is a somewhat unstable
thing to do as a small change in the wind can tip the boat over
altogether. On the other hand, it's the quickest way to get to where you
want to be if that happens to be upwind.

Similarly, advertising in the microsoft newsgroups reaches a large and
highly focussed audience: but it's widely frowned on and can call down a
severe flaming on its perpetrator. We do give advice and recommendations
for various products, often disclaimed by something like "I do not work
for this company", etc. This example, though, was just a bit blatant.

All the best


Tim F
 
It's a nautical phrase: sailing close to the wind is a somewhat unstable
thing to do as a small change in the wind can tip the boat over
altogether. On the other hand, it's the quickest way to get to where you
want to be if that happens to be upwind.

Similarly, advertising in the microsoft newsgroups reaches a large and
highly focussed audience: but it's widely frowned on and can call down a
severe flaming on its perpetrator. We do give advice and recommendations
for various products, often disclaimed by something like "I do not work
for this company", etc. This example, though, was just a bit blatant.

All the best


Tim F


I see. Thanks for the info.
 
Back
Top