Introduction A picture is a graphical object that either is displayed on a form or report or is used as the background of a form or report. Microsoft Access supports various types (extensions) of pictures, some of them can display directly on a form or report but some others can only be represented. Microsoft Access makes it possible and easy to display a picture on a form or a report. To take care of this, after displaying the form or report in design view, in the Controls section of the Design tab of the Ribbon, click Image and click the form or report. This will open the Insert Picture dialog box from which you can locate and select the picture. Practical Learning: Binding an Object
A logo is a picture that represents or symbolizes a company. To add a logo to a form a report, display the form or report in Design View. In the Controls section of the Ribbon, click Logo . This would open the Insert Logo dialog box where you can select a picture. Practical Learning: Adding a Logo
Document and Object Linking Introduction Object Linking and Embedding (OLE) consists of adding or positioning an object, any object, to or in another object. In a Microsoft Access database, OLE makes it possible to add an object that was created using another application. The object can be positioned on a form or report. When the user accesses the object, Microsoft Access tries to display the object directly on the form or report. If the object (itself) cannot be displayed (for any reason), Microsoft Access displays an icon. On a form, the user can double-click the object or the icon. In this case, Microsoft Access will look for a local application that can open the object. A bound object is one that is tied to an existing column of a table. This means that the table must have a column that can use bound objects. To support OLE objects, Microsoft Access provides the OLE Object data type. To apply the OLE Object type to a column:
Practical Learning: Creating and OLE Object Field
Adding an OLE Object to a Form or Report To use an OLE object in a field, you can work from the Datasheet View of a table or the Form View of a form. When a table has a column that is OLE Object-based, you can drag that column from the Field List and drop it on the form or report. To add an OLE Object control to a form or report in the Design View, in the Controls section of the Ribbon, click Bound Object Frame and click the desired area of the form or report. You can then design the size and position of the frame as you see fit. Since the object is (supposed to be) bound to a field on the source table (or the source report), specify its column in the Record Source property. Selecting an OLE Object for a Form or Report After setting the Data Type of a field to OLE Object, to include an external object into the field, whether using the table Datasheet View or the form in Form View, right-click the field and click Insert Object. This would open the Insert Object dialog box that presents two options to create or select the object:
Practical Learning: Using OLE Objects
Introduction An object is said to be unbound if it is not linked to a column of a table. Microsoft Access supports all types of objects because such objects are actually embedded on the form or report. This means that an object like a picture or an icon may simply represent the object that is actually located somwhere else. Here is how it works. When you add an unbound object to a form, Microsoft Access tries to display that object. If it cannot, then it displays an icont that servers as a link that the user can click or double-click. This would launch an application that can open the object. Using an Unbound Object To add an unbound object, display the form or report in Design View. In the Controls section of the Ribbon, click the Unbound Object Frame button and click the form or report. A wizard will help you select the object you want to add to your form or report. In the same way, you can add as many unbound objects as you need to a form or report. |
The Web Browser Introduction A web browser is a control that shows a file. The file can be a regular picture or a web address that is identified as a Uniform Resource Locator (URL). A web browser is very flexible with the type of document it can show. Still, you must follow some rules to prepare the document. The primary type of document intended for a browser is a webpage. You probably already know how to create such a document. A browser can also be asked to display a picture. The web browser of Microsoft Windows supports various or all types of pictures, including those with the extensions .bmp, .jpg, .jpeg, .gif, .png, etc. A web browser can be added only to a form. To get it, after displaying the form in Design View, in the Controls section of the Design tab of the Ribbon, click the Web Browser Control and click the form. Practical Learning: Introducing the Web Browser
Characteristics of a Web Browser Probably the most important detail of a web browser is the document it displays. This is specified by the Record Source property. You cannot create a web browser on a table. Instead, you can create a text-based field, then use it as the record source of a browser. When performing data entry, enter the name of the file with extension, the complete path and name of the file, or the URL of the web page that the browser would display. Practical Learning: Using a Web Browser
Web Browser Events The web browser has many events appropriate for its functionality:
We already know that you can submit the path of a file or a URL to it. When a file path or a URL is given to a web browser, before it processes it, the control fires an event named On Before Navigate. If there is no problem in this event, the control shows the file or the web page. When the control has finished displaying the document, the web browser fires the On Document Complete event. If there is a change on the document, the control fires an On Progress Change event. When a web browser has received a file path or a URL, it makes an attempt to show that file or the web page. If it encounters a problem, it fires an On Navigation Error event. At any time, and if you allow it, the user can change the document the control is displaying. When a new document must be displayed, the control fires an On Updated event. Introduction The OLE Object provides a convenient means of adding an external file to a record. One of the problems with it is that it can add only one object. Sometimes you want to associate many documents to one record and you may have a different number of objects for different records. Microsoft Access solves this problem through an attachment. An attachment is a technique of associating one or more files to a record. Practical Learning: Introducing Attachment Fields
Creating an Attachment Field You can create an attachment field in the Datasheet View or in the Design View of a table. To create an attachment in the Datasheet View:
If creating a table in Design View and if you are creating a new column, to configure it to hold one or more attachments, specify its Data Type as Attachment. If a field has already been created and the records have been added to the table, you cannot change the data type of a field to Attachment. You would receive an error when you try to save the table: In other words, you can specify the Attachment type only if you are creating a new field. After creating an attachment field on a table, you can configure it on a related form. In the Controls section of the Ribbon, the attachment is represented . Practical Learning: Creating an Attachment Field
Using an Attachment You can add the attachment(s) either in the Datasheet View of a table or in the Form View of a form. Once the object is displaying, you can either double-click the field or right-click the field and click Manage Attachments. This would open the Attachments dialog box: In the Attachments dialog box, to create an attachment, click the Add button. This would open the Choose File dialog box. It behaves like the Open dialog box. When using it, select the file or object and click Open. The selected object would be added to the Attachments list view. In the same way, you can add the other objects one at a time. Alternatively, to add many objects, in the Choose File dialog box:
To remove an item from the collection, click it in the Attachments list box and click Remove. Once you are ready with the list of attachments, click OK. After the attachments have been created, to access those of a record, navigate to that record. Then, right-click the placeholder of the attachment. A menu would come up. Among other menu items, the menu has a Forward and a Back options:
Practical Learning: Attaching Objects to a Record
|