Basically it is a form that is not bound to any database table or query. You can usually determine if a form (or a control on a form) is bound by looking at its record source property which will either be bound to a Table, Query or SQL String. Also if you look at each control on the form you will find that each control has a Control Source, which is derived from the field names made available in the Record Source. A bound form is easier to create and requires minimal programming (if any). It allows for rapid application development since Microsoft Access is designed to make application development fast and easy. An unbound form on the other hand requires a lot of programming, BUT gives you near total control over how your application is going to work. This in some cases outweighs the numerous benefits offered by bound forms.
In the first installment of the series on unbound forms in Microsoft Access, we are going to take a look at how to create a unbound form, but first let’s create the database from which we will get our data.
The contacts database has one table called contact with the following fields:
|Field Name||Data Type|
|cid (Primary Key)||AutoNumber|
Copy and paste or import the following sample data into the contact table:
1,"Axaro Dausab","255 Amite Street","email@example.com","Market
2,"Khagu Noabes","58 Xamiseb Road","firstname.lastname@example.org","Medical Student","22"
3,"Dantago Nuseb","2 Nuseb Street","email@example.com","Medical Student","22"
4,"Phuna Noabeb","2 Nuseb Street","firstname.lastname@example.org","Web Designer","30"
5,"Aribasen Seibeb","58 Xamiseb Road","email@example.com","Researcher","35"
6,"Zion Maletzky","58 Xamiseb Road","firstname.lastname@example.org","Web Designer","20"
7,"Leidago Noabeb","277 Mudi Road","email@example.com","Web Designer","30"
8,"Amite Itheke","26 Shanke Road","firstname.lastname@example.org","Market Analyst","40"
9,"Amire Ganuseb","23 Ganuseb Road","email@example.com","Fashion Designer","45"
10,"Dinashange Develo","40 Develo Road","firstname.lastname@example.org","Journalist","23"
If you want to use your own data it is fine, but for the sake of facilitating things I would recommend using the sample data.
So the structure of your contact table should now resemble something like this:
And with sample data it should look something like this:
We are going to have two forms that we will use to manipulate data contained in the above table. The first form will enable us to view the data in the table. It has the following design:
Five text boxes, one label, one button and a listbox (linked to query) appropriately named after the columns in the table;
The form has two sections, the first of which enable us to go through a list of different contact names and the second part shows all the different details of the selected contact name:
The list box that contains the names of the contacts is linked to a query that retrieves all the data from the contact table using the following sql:
SELECT * FROM contact;
The query is stored as “getdata” under the queries tab. Once you click on any of the names on the list, the other details of the contact is then displayed in the appropriate text boxes. Also, next to the list box in the above image you will notice the number seven, which is the auto generated id of the contact, which we will use later for searching and updating.
In the next installment we will look at how to add new contacts to our table using an unbound form » Adding Data with Unbound Forms in Microsoft Access