Making paths/shapes in Access? (1 Viewer)

JGalletta

Windows 7 Access 2010
Local time
Yesterday, 22:16
Joined
Feb 9, 2012
Messages
149
Is it possible to make a path or a shape in access? I'd like to do some graphical representation of some data and change colors of the shapes based on given values that would correlate to the shapes. Any ideas?

Thanks in advance,

John
 

JGalletta

Windows 7 Access 2010
Local time
Yesterday, 22:16
Joined
Feb 9, 2012
Messages
149
Does anyone have any input on this - even a, "no access doesn't do that," would be fine.
 

MikeLeBen

Still struggling
Local time
Today, 04:16
Joined
Feb 10, 2011
Messages
187
Well the first thing that comes to my mind is pictures in forms
 

vbaInet

AWF VIP
Local time
Today, 03:16
Joined
Jan 22, 2010
Messages
26,374
I know that you can draw Lines and Circles in a report but that's about as far as you will get with shapes in Access. Access just isn't built for this. You might be able to find a Shapes class that you can use but I won't count on it.

I believe you will find some interesting examples in the Code Repository or Sample Databases section of the forum.
 

micks55

Registered User.
Local time
Today, 03:16
Joined
Mar 20, 2006
Messages
110
I have represented doors with windows on screen and in reports so maybe you could draw boxes to represent your data. I did it by setting a scale based on greatest dimension then applying left,top,width and height to boxes. Where round windows are required, I used an image of a circle. It's all very tedious and messy but looks good when image appears as user enters the dimensions. You should work in TWIPS but you can avoid that with *567 as in this example of placing the first box (it uses Up and In as the distance from the bottom and the leading edge of the door):
If Me!L1high1 > 0 And Me!L1wide1 > 0 And Me!L1up1 > 0 And Me!L1in1 > 0 Then 'when dealing with Twips
Me!Rect1a.Visible = True
Me!Rect1a.Top = Me!RectA.Top + (((Me!DoorHeight - Me!L1up1 - Me!L1high1) / Ratio1) * 567) 'only change field values
Me!Rect1a.Height = (Me!L1high1 / Ratio1) * 567 'by multiplying by 567
Me!Rect1a.Width = (Me!L1wide1 / Ratio1) * 567
If Me!L1Hand = 1 Then
Me!Rect1a.Left = Me!RectA.Left + (Me!RectA.Width - ((Me!L1wide1 + Me!L1in1) / Ratio1) * 567)
Else
Me!Rect1a.Left = Me!RectA.Left + ((Me!L1in1 / Ratio1) * 567)
End If
End If
 

JGalletta

Windows 7 Access 2010
Local time
Yesterday, 22:16
Joined
Feb 9, 2012
Messages
149
My VBA is strong. I'm quite comfortable with the programming aspect, but my knowledge of methods is not as complete as I'd like it to be. The reason I'm asking this question is to forgo the usage of Google Earth or any other mapping programs to highlight regions on a map. I can do this with XML via Google Earth, but I'd rather the Access application utilize it's own means rather than tapping into, opening, and manipulating other programs (but I'm not knocking that either). At the moment, my database sends a .dbf file (if I'm recalling correctly) to an Ancient version of ArcView to generate map views, layouts, and legends. I would love it if all of this could be internalized - it would broaden the spectrum of user levels that would be able to utilize the functionality of my DB.
 

ChrisO

Registered User.
Local time
Today, 12:16
Joined
Apr 30, 2003
Messages
3,202
Is there some way you could reduce the complexity of what you are asking?

For example: I have a polygon which I would like to fill with a colour.

Is that close? :confused:

Chris.
 

JGalletta

Windows 7 Access 2010
Local time
Yesterday, 22:16
Joined
Feb 9, 2012
Messages
149
Is there some way you could reduce the complexity of what you are asking?

For example: I have a polygon which I would like to fill with a colour.

Is that close? :confused:

Chris.

Yes, that's exactly what I'd like to do.
 

JGalletta

Windows 7 Access 2010
Local time
Yesterday, 22:16
Joined
Feb 9, 2012
Messages
149
Does access support photo file types with transparent backgrounds? Like this .png file:



If so, I can create polygons as .png files with transparent backgrounds to overlay on top of a photo of a map without any parts of the map being covered other than the part covered by the polygon. I think this solution might make the most sense. I would then be able to create polygons of several different colors for each region I'd like to overlay to reflect different data for each region.
 

ChrisO

Registered User.
Local time
Today, 12:16
Joined
Apr 30, 2003
Messages
3,202
For that I think you will need to go to Stephen Lebans site.

Two possible ways I can think of:-

1
http://www.lebans.com/imageclass.htm
The above uses Image Controls on Forms to allow drawing polygons using API calls. Those API calls are called by wrappers which appear to comply more with VB than VBA syntax. That was the method I used in the second link I gave in post #6

In the download available from Stephen, the sets of vertices would need to be saved in a table. That would allow the number of sets of vertices to vary from polygon to polygon. In other words polygons on the one side with vertices on the many. The fill colour could be conditionally set on the fly.


2.
http://www.lebans.com/transparent.htm
Images can have transparent backgrounds. Stephen has provided a way to convert images to Enhanced Metafile format which can then be loaded into an Image Control. That was the method I used for the chess pieces in this thread:-
http://www.access-programmers.co.uk/forums/showthread.php?t=204786



Chris.
 

JGalletta

Windows 7 Access 2010
Local time
Yesterday, 22:16
Joined
Feb 9, 2012
Messages
149
Thanks, Chris. This is some good stuff. I'll certainly be looking it all over when I decide to dive back into my DB. As for now, we're in the height of blueberry season in South Jersey, and my DB is working it's bippy off. When things start to slow down, I'll certainly have more time to play! ;)
 

Users who are viewing this thread

Top Bottom