Access: Add a Webslice to a Webcontrol


Websclice in a webcontrol

In this post i’ll show you how to add a webslice to a webcontrol in Access 2010. I got the idea watching the video from Albert Kallal. He created a webdatabase called “Room Bookers”. In this database Albert used various techniques to try out the new web database technology added in the Access 2010 version.

Now one of the features I liked was the fact that he imlpemented a webcontrol showing the weather in a certain place. That’s what I wanted to try. The webcontrol is a control you can add to your form in Access. You can use it (among other things) to show internetpages or webslicers. Webslicers are designated pieces which are a part of a website. In the weather part I just wanted a piece of the website to use in my Access form. So here we go.

Add the webcontrol to the form

First create an empty db with one form. On this form add a webcontrol which you can find in the ribbon under controls. After you click the webcontrol on the form you’ll be prompted to enter the hyperlink or webaddress. In this case I added the webaddress from Bing. The webcontrol got filled with the complete website and that’s not what I wanted. I just wanted the little piece showing me the weather. So how did Albert do this? He used a webslice instead of a whole website. Ok so it’s of to create a webslice.

Create a webslice
websliceNow how do you create a webslice? First it’s of to Internet Explorer. Then I searched with Bing for weather and got several results. The first one is
the most interesting because it has a special feature.
When you hover your mouse over the first part of the website a little green box appears around a square block which appears around the first feature on the site. Great this is what’s called a webslice! So go ahead and create a webslice from this bly clicking on that green icon on the upper left corner. You’ll see the following dialog appear:

 
Now for ease of use I added it to the favorites bar so I can check if it’s really there.

 

 

 

 
and it is! Now all I have to do is copy the url from this webslice and paste in into my own webcontrol used in the database.

 

 

 

As you can see I added the webslice address to the address of the [Insert Hyperlink] dialog and clicked OK. Now let’s see if this worked on my form.

 

 
and it did, wow this is a great feature! I removed the borders to give it a nice looking effect otherwise you will see those scrollbars etc. So i set the scrollbars to [No]. Now you give it a try! Happy slicing 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s