nhior.it@gmail.com +966534401783
June 25, 2023 - BY Admin

Google Map in MS Access

How to Open Pin Google Map in MS Access


To open a specific location or pin on Google Maps within an MS Access program, you can use the Shell function or the WebBrowser control. Here's a general approach using the WebBrowser control:


  1. Open your MS Access database and navigate to the form or report where you want to include the Google Maps functionality.
  2. Insert a WebBrowser control onto the form or report. You can do this by going to the Design View, selecting the "Insert" tab, and choosing the WebBrowser control from the ActiveX controls.
  3. Set up the WebBrowser control properties:

    • Name the control appropriately (e.g., "WebBrowser1").
    • Set the control's Source/ControlSource property to a blank web page or an initial URL (e.g., "about:blank").
    • Create a function or event handler to dynamically generate the Google Maps URL for the desired location and update the WebBrowser control's Source property with the URL.

      Here's an example VBA code snippet that opens Google Maps with a pinned location based on latitude and longitude values:


      Private Sub OpenGoogleMaps() Dim lat As String Dim lon As String Dim url As String ' Define the latitude and longitude values for the location lat = "40.712776" lon = "-74.005974" ' Construct the Google Maps URL with the latitude and longitude parameters url = "https://www.google.com/maps?q=" & lat & "," & lon ' Update the WebBrowser control's Source property with the URL Me.WebBrowser1.Source = url End Sub



      1. Trigger the function or event handler that opens Google Maps with the pinned location. This can be done through a button click event, form load event, or any other event suitable for your scenario.
      2. Save and run the form or report to test the functionality. The WebBrowser control should display Google Maps with the specified location pinned.

      Remember to adapt the code to fit your specific requirements, such as retrieving the latitude and longitude values from an MS Access table or form field.

      Note: The WebBrowser control may have limitations and behavior differences depending on the version of MS Access you are using and the system configuration.



      0 ITEMS
      $ 0