Access is only to display the map (*.TAB) from Mapinfo. And by using Mapbasic command I want to automate shade the map based on one field within the mapinfo's table.
I have gather the Mapbasic command, which I have no clue to write it in VBA.
- shade 1 with Thn_Tnm ignore "" values
-
"1995" Brush (2,16752800,16777215) ,
-
"1996" Brush (2,16777104,16777215) ,
-
"1997" Brush (2,16749680,16777215) ,
-
"1998" Brush (2,7381247,16777215) ,
-
"2003" Brush (2,16744640,16777215) ,
-
"2004" Brush (2,11796288,16777215) ,
-
"2005" Brush (2,61680,16777215) ,
-
"2009" Brush (2,16760832,16777215) ,
-
"2010" Brush (2,53352,16777215) ,
-
"Empl" Brush (2,10543359,16777215) ,
-
"Encl" Brush (2,16752848,16777215) ,
-
"PKS" Brush (2,10551295,16777215)
-
default Brush (2,0,16777215) # color 1 #
The above code will shade the map (thematic map) based on plant's planting year with each brush code define the forecolor and backcolor.
What I am confuse is how to select and grouping the year from the table and inform the mapinfo to shade based on them. I have prepare the identical temp table in Access to try to group them.
Also think to build a ready-made workspace from mapinfo, so I can easily use from within VBA. But I am stuck, because I can't make the workspace works in VBA by using this code.
- Sub Form_Load
-
-
Dim mi as object
-
-
Set MIObject = CreateObject("mapinfo.application")
-
MIObject.do "Set Application Window " & Me.hwnd
-
MIObject.do "Set Next Document Parent " & Form_frmMapInfo.Controls!DisplayMap.Form.hwnd & " Style 1"
-
MIObject.do "Run Application """ & CurrentProject.Path & "\world.wor""""
-
MIObject.runmenucommand 1702
-
wnd = MIObject.Eval("FrontWindow()")
-
MIObject.do "Set Window " & str$(wnd) & " Min"
-
MIObject.do "Set Window " & str$(wnd) & " Max"
-
MIObject.do "Set Window " & str$(wnd) & " ScrollBars On"
-
MIObject.do "Create Menu ""Mapper Shortcut"" ID 17 As ""(-"" "
-
-
End Sub
Or maybe someone have another working method?