Sunday, May 1, 2011

Microsoft Access: Web Browser Control

I love how on websites you can click to view a map. Somehow the address fields are set to map to a mapping program, such as Google Maps or Mapquest, and you’ll see a map to your destination. You can now replicate this on your Access forms using the Web Browser Control.

First, go to your favorite map site (I found deciphering Map Quest was easier), type in your address (you'll delete this later) and locate it on the map. Copy the URL.
  1. On the Form Layout Tools|Design ribbon, in the Controls group, select the Web Browser Control, and then click to place it on the form. Access opens the Insert Hyperlink dialog box.
  2. Paste the URL of the web page into the Address: field of the Insert Hyperlink dialog box, and then press TAB on the keyboard to move to the next field. Access clears the Address: field and separates the URL into the appropriate fields.
  3. To set the control so that its URL changes based on the data that is displayed on your form, you must replace the appropriate URL components with expressions that refer to the appropriate controls on the form. Here's where having your address helps you locate the correct areas for your fields.
    1. Click the path or parameter that you want to replace, and then click the Build button.
    2. In the Expression Builder, double-click the control that contains the data you want.
    3. Click OK to close the Expression Builder.
  4. Click OK.

    No comments:

    Post a Comment