Class Modules – Unbound Forms i – How To Create An Unbound Form

In this post we will be showing you how to create an unbound form.

Why Use Unbound Forms?

Traditionally, when you create a form in MS Access, it will be bound to a recordset (for the sake of simplicity think of a recordset as a table). This means that there is a very direct link between a bound form and the table it serves. The fields in the table are represented in the form and you can use the navigation buttons to move from record to record, saving, undoing and deleting as you go! The concept of a bound form makes it really simple to create good quality forms in MS Access that have all the necessary functionality present that a user needs. There are a couple of drawbacks though.

When a form bound to a table is opened up, the data is locked to some degree so if another user wishes to update data on the same table, you may get “locking issues”. This locking of the data can be problematic in a multi-user environment as more than one user may wish to view the same data from the same table at the same time. The user who opened the form first will have access to manipulate the data whilst the other user will be “locked out”.

In order to combat this problem (locking recordsets is a perennial problem in databasing), Access offers you the ability to use unbound forms. An unbound form is a form that is not tied to a recordset (table) and therefore not under any locking restrictions. An unbound form is, in effect, nothing more than a collection of labels, text-boxes and buttons that have been arranged for data to be displayed.

Unbound forms solve one problem but they do have their downside too. A lot of the work required to work with a recordset is done by Access when using a bound form. When you use an unbound form you are required to do a lot of this work yourself. This, in truth, is more a trade-off than a downside as a lot of developers prefer to have complete control over the way in which data is handled by their databases.

It is worth pointing out here that, even in multi-user environments, most of your forms will be bound and will require nothing more than the standard treatment. If you do find yourself in the situation where a heavily used form is causing lots of locking issues, an unbound form that references methods from a class module could well be the answer .

How To Create An Unbound Form

If you need to create an unbound form for a table, rather than create a form from scratch, create a bound form and then remove the recordsets from the form and the text boxes respectively.

Open the form in layout or design view and then choose Form from the property sheet drop-down menu. On the data tab remove the record source. In our case the form is bound to a table called Films. To delete it, just highlight the record source (Films) and press delete on your keyboard.

WithRecordsetThe property sheet should now look like this:

WithoutRecordsetChange the drop down menu to select the relevant text-boxes on the form and perform the same action.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Visit Us On TwitterVisit Us On FacebookVisit Us On Youtube