I'm kind of new to VB and DAO so please bear with me on this! I'm not sure if this belongs in gis.se or stackoverflow.
I am trying to embed a simple MapInfo map in an Access form based on the code provided in the MapInfo user guide. It seems I've fallen at the first hurdle. So far I have this:
Dim mi As Object
Private Sub Form_Open(Cancel As Integer)
Set mi = CreateObject("MapInfo.Application")
MsgBox (mi)
mi.do "Set Application Window " & Form1.Hwnd
mi.do "Set Next Document Parent " & Form1.Hwnd & " Style 1"
mi.do "Open Table ""World"" Interactive Map From World"
mi.RunMenuCommand 1702
mi.do "Create Menu ""MapperShortcut"" ID 17 As ""(-"" "
End Sub
I am getting runtime error 424 "object required" on this line:
mi.do "Set Application Window " & Form1.Hwnd
The MsgBox outputs "MapInfo Professional" which leads me to believe that the CreateObject command has worked successfully. However if I comment out the problem line I get the same error on the next line. Therefore I assume that the mi variable isn't correctly set up.
Can anybody shed any light on this?
Are there any good resources on line for MapInfo integrated mapping?
Thanks in advance!