This sample code database is meant to share several VBA solutions for using the MapWinGIS Active X component in Access, using a database of borehole point data. Functionality includes displaying any shapefile, generating point shapefiles from the database, handling a number of standard map features such as scale bar, scale drop down, cursor location, map identifier, coloring points according to value, etc.
I had difficulty finding more complete solutions for VBA/Access in the MWG online resources (probably because few people work with VBA). But of course the solutions used in the DB rely on various contributions at the mapwindows.org site in one way or another.
So I hope that this example database might help someone else working with VBA and Access (point data) and starting from scratch with MWG. The coding is amateur, but hey, it works. Commenting of the code is not great, so contact me if you want better.
The icons used for the map buttons are by Robert Szczepanek, [robert.szczepanek.pl]
The borehole data is scrambled wrt location and attributes. A point shapefile has already been generated, and is in \output\SHP, but you can also generate a new one in the map interface. Other user actions:
- toggle layer visibility
- label fields
- color points in relation to limit value
- color points with a color range
- draw or click to select points (map identifier)
- double click in identifier to edit record
- toggle visibility of layers
Designated subfolders with respectively, shape files to display, and shapefile output are included in the svn posting.
I would of course welcome feedback and code improvement suggestions, mail at whitepine.se.
can you please psot this project in a zip file ?
If mapObj Is Nothing Then Set mapObj = Me.mapCtl.Object
at the beginning of the form_load module.