Help with Getting maps into reports (1 Viewer)

Leshunter

Registered User.
Local time
Today, 01:41
Joined
Nov 21, 2017
Messages
13
Hi All, i am very new to vba Just taken it up to while away the hours (hopefully years) of retirement, I am creating a database for my son I am very stuck on this and any help would be appreciated.
I have created a form with names and addresses, I then use the postcode element to create a google static map into the web browser so far so good.(except i cannot get any markers to show,) (that's another question).
back to the main problem I want to create a report to include the map which can be printed and given to his staff when they go out on location. But after spending hours trying and researching the forums I cannot seem to get an answer to this problem. Any help would be gratefully received.
Les Hunter AKA yorkist
 
Last edited:

Leshunter

Registered User.
Local time
Today, 01:41
Joined
Nov 21, 2017
Messages
13
Hi Ridders
Thanks for the quick response. I have actually looked at both of your databases and found them extremely useful and informative but a 'little bit' over my knowledge base. I am trying to find a solution without all the bells and whistles, without much luck I may add. If you could point me in the right direction I would really appreciate it.
Thanks again for the response
Les
 

isladogs

MVP / VIP
Local time
Today, 01:41
Joined
Jan 14, 2017
Messages
18,212
Not at my computer the moment so can't give a detailed response.

If you think that's got a lot of bells and whistles, you should see the final version which is shortly going on sale:
http://www.mendipdatasystems.co.uk/uk-postal-address-finder/4594138311

The approach I use is to save the static map as an PNG image file which is then displayed in both forms and reports.
The map is based on the lat/long values for each postcode.
The process is effectively instantaneous

When a new postcode is selected, the map is overwritten.
However if preferred, you could save each map as separate files which could be reused.

HTH
 

Leshunter

Registered User.
Local time
Today, 01:41
Joined
Nov 21, 2017
Messages
13
Thanks once again for your response. I will have another look at the examples and see if I can make more sense of them. I like the look of the new software it looks as if it contains everything anyone would require from maps and more
Thanks again for your time
Les
 

isladogs

MVP / VIP
Local time
Today, 01:41
Joined
Jan 14, 2017
Messages
18,212
You're welcome.

If you installed either of my examples, you should be able to find the code used to get the static map and save it as a file in the GetMapImage procedure.

If not, send me an email using the link in my signature line and I will send you that code in my reply

The Google maps API documentation is very clear and will certainly help you understand how to add markers
 

moke123

AWF VIP
Local time
Yesterday, 20:41
Joined
Jan 11, 2013
Messages
3,913
Heres another sample with just the basics.
 

Attachments

  • Gmap.accdb
    488 KB · Views: 70

Leshunter

Registered User.
Local time
Today, 01:41
Joined
Nov 21, 2017
Messages
13
Hi moke123
Thanks for the sample very kind of you, however I have got beyond there, it's the report thing that's got me stumped.
Again thank you for taking the time to respond
Regards
Les Hunter
 

isladogs

MVP / VIP
Local time
Today, 01:41
Joined
Jan 14, 2017
Messages
18,212
Hi les
Just picked up your email and will get back to you.
 

moke123

AWF VIP
Local time
Yesterday, 20:41
Joined
Jan 11, 2013
Messages
3,913
create a google static map into the web browser
Use an image control in your report not a browser.
My example, and colins Im assuming, saves a copy of the static map. mine is saved in the apps root folder and you just use that path to set the picture property.

here's a link to where I learned how to get a map in a report...http://accessmvp.com/thedbguy/demos/googlemaps.asp
 

isladogs

MVP / VIP
Local time
Today, 01:41
Joined
Jan 14, 2017
Messages
18,212
After experimenting several months ago with both static maps in an image control and online maps in a web browser, I found the latter to be problematic and stopped using them myself.

I've already sent Les a solution using both methods but suggested that the static image was much better
 

Leshunter

Registered User.
Local time
Today, 01:41
Joined
Nov 21, 2017
Messages
13
hi colin
Thank you very much for the files extremely grateful
 

Leshunter

Registered User.
Local time
Today, 01:41
Joined
Nov 21, 2017
Messages
13
hi Moke 123 Thanks for the link and your time I think ridders as sorted me out now Thanks again for your time in answering
 

Leshunter

Registered User.
Local time
Today, 01:41
Joined
Nov 21, 2017
Messages
13
Hi ridders
sorry to be a PITA but I think I spoke too soon.
I have now integrated the files into my database and this as caused some peculiar actions
when the form is opened it gets focus and downloads the static map and the live map but without the google blue banner,it then goes on to open 2 more browser windows onto the internet outside the software.
When these are closed and the next time I search the live map does not show but the 2 IE browsers open again
Any Ideas ????

Les Hunter
 

isladogs

MVP / VIP
Local time
Today, 01:41
Joined
Jan 14, 2017
Messages
18,212
I've rechecked & it doesn't do that (for me) in the file I sent you.
So it sounds like something to do with the transfer process.
Did you for example copy the table tblSettings into your db.
If not, do so.
Check the Map Provider is set to Google.

Are you getting compatibility view errors with the live version in the web browser?

Beyond that there's nothing obvious I can tell you.
I would step through the code using breakpoints to determine what each line of your code does so you can fix it.

TBH this is a fairly advanced project and you describe your skill level as being some distance from that

Personally, I don't see any point having both a static map and a live map in a web browser in the same form. The static map works well. The web browser bit is less reliable. I would scrap it.

If you really want a live map as well, I would instead have a button that opens the map in the external browser full screen

HTH
 

Leshunter

Registered User.
Local time
Today, 01:41
Joined
Nov 21, 2017
Messages
13
Hi ridders
yes I did copy the tblsettings
And No i am not getting any compatibility errors either.
It all works fine until I put it into the rest of the database,
I think you are right on the live maps I will just place a button somewhere to open a browser.
I also think that it would be better to have 2 static maps of different levels so that they can be printed out on the same report.
Once again thank you for your advice and help in the past and for the speedy response
Les
 

Users who are viewing this thread

Top Bottom