Access forms. Creating data entry forms

Access is a powerful Windows application, database management system (DBMS ). Its purpose is to present information in a user-friendly form, automate operations that are often repeated. The program also helps in the search and storage of data. Access forms do all this. Creating forms is a simple task, designed to help the user as much as possible.

access forms creating forms

In the Access form, as in a storefront, it’s convenient to view and open the necessary elements. Since a form is an object with which users can add, edit, and display data stored in Access, its appearance plays an important role.

If the database of the classic Access application is used by several users, well-designed forms are the key to the accuracy of the data and the efficiency of working with them.

Create forms

Access DBMS offers the user a convenient mechanism for working with data. These are special Access forms that greatly facilitate data entry, editing, and viewing. They are a special object in this DBMS and have a rich arsenal of controls that automate the presentation of data stored in database tables. These are text fields, flags, radio buttons, drop-down lists, and more.

creating forms in access

There are many ways to create forms in Access:

  • creating forms based on existing tables and queries;
  • creating blank forms;
  • divided forms;
  • Multiple Entry Forms
  • subordinate Access forms.

Creating forms is carried out using the form wizard, a special constructor.

They are especially convenient if, for example, you need to enter data from special forms. For this, the form of the form, the data entry fields are specially made the same as on the form.

Forms Based on Existing Table

Creating forms in Access based on an existing table is very simple. To do this, in the "Creation" section, click the "Form" button. The main condition in this case is the preliminary creation of a table with data, as well as its selection in the navigation area. Only one record will be displayed on the form, as well as data from the linked table.

creating subforms in access

To display several table entries in a form, in the same "Creation" section, select the "Multiple Elements" button. So we can display in the text fields of the form a number of data records with all fields of the table.

Based on an existing table, creating forms in Access also allows you to develop a split form. This is a view that, together with the presentation of data in the controls, presents a selection of data in parallel in a table form. To create a split form, in the "Create" section, select the "Split form" button.

Such forms appear already immediately formatted using numerous controls. Most often, such elements are single-line text fields, where the data values ​​stored in the table fields are displayed. Instead of pre-formatted, you can make empty forms.

Layout mode

Ready-to-use tables are put into form mode. In this mode, you can change only the data of the records of the database tables, go between these records. Formatting in this mode is not allowed, and creating Microsoft Access forms requires formatting the controls and the form itself. All this can be done if you switch to layout mode or design mode.

ways to create forms in access

Layout mode differs from constructor mode in less ability to design forms. However, it is very convenient for quick formatting, for making minor changes to controls: vertical or horizontal alignment, adding additional text fields, changing the external style of the form, and more. In layout mode, you cannot change the data displayed in the controls, while design mode provides this option.

Customizing forms in design mode is more complex and thorough. In addition, only in design mode is a number of graphic design elements available, as well as controls: rectangles, lines, buttons, combo boxes, radio buttons and more. In this mode, you can change the data source for the editable form. Moreover, you can disable layout mode from this mode.

Adding a button to a form

For example, you need to add a button to a form with which you have to close it. In design mode, a whole layout of different controls will be available, including a button. If you add it to the form layout, the DBMS will automatically execute the button creation wizard, the window of which will appear in front of the user.

creating microsoft access forms

The button creation window will offer you a choice of several categories that contain lists of actions. In our case, you must select the category "Work with the form." From the list of actions in this category, select "Close form".

The next step is to inform the user that this button is responsible for closing the form. You can leave the text on the button, or you can tell about it with the help of an icon (picture).

Next, the wizard will ask the user to give a name to the button, after which you can click "Finish" - this will turn out the finished button on the form, which will close it.

If you now click on the created button, the DBMS will offer to save the changes created in the form, and then close it. In design mode, this button will not work. It works only in the finished form mode.

It must also be said that the forms themselves can be made using a special wizard. During the construction by the master of the form, you only need to decide on its settings. Further, the form created by the wizard is easy to format at your discretion, switching to layout mode or design mode.

Subordinate Forms

A subordinate form is an element that complements another, basic Access form. Creating subordination forms is the development of a hierarchical structure of two tables, reflecting the existence of relations between forms.

Relations between them can reflect the different type of relationship that exists between database tables: one-to-many, many-to-many. Often, these relationships are considered in the context of a kinship with the presence of a parent (main) form and a daughter (subordinate).

What is subordinate form?

Creating subordinate forms in Access can be explained by an example: this form can be the form of customer orders in the online store.

creating the main form in access

Information about the buyer is contained in one table, and information about his orders is stored in another in connection with the normalization during the design of the database. Several orders correspond to one buyer at once, therefore the relationship between the tables of the buyer and orders reflects the one-to-many relationship. In this case, the form representing the buyer’s data will become the main one. Another, representing the data of his orders, will be added to the main one and will be subordinate.

Located in the same layout space, the main and subforms show only related data. So, if a unique customer is in the customer table, and three records are associated with him in the subordinate order table, then the subform will display all three records of his orders.

Form Wizard

There are several ways to create a hierarchical design from forms in Access. For example, implementing a script to create both the main and subordinate forms, you can resort to the help of the form wizard.

creating a button form in access

Creating a master form in Access, containing a subordinate, using the wizard, is easy. He will not only create the forms themselves, but also connect them with the necessary attitude. If the scenario for creating a subordinate form involves adding it to an existing main one, then you can either use the wizard or simply drag an existing table onto the main layout and make it subordinate.

Creating Submission Forms

Create subforms based on two related tables (Authors and Books). We will use the form wizard for this. First of all, we’ll open the wizard itself, the execution command of which is located in the Access DBMS (creating forms). In Access 2007, for example, it can be found in the drop-down list of the “Other forms” item.

The opened wizard window will offer you to select the table for which you want to create forms, as well as the fields (double-click selection) that the user would like to see. After the first table in the same window, you will need to select another one that has a connection with the first. The master will independently discover the relationship, and if he can’t do it, then he simply is not able to create subordinate forms. In our case, the form created on the basis of the Books table will become subordinate.

In the next step, the wizard prompts you to select the type of data presentation. We need to select "Subordinate Forms", and then click the "Next" button again.

The next step will give us the opportunity to choose the appearance of the created forms: tape or tabular layout. I must say that the ribbon is richer in design styles.

At the last step, we will need to configure the headings of the forms, and then click "Finish" - subordinate access forms will be saved. Creation of forms is completed.

The created design can be switched to design or layout mode. This will be necessary in order to format the resulting fields or add other controls.

Creating a Button Form in Access

The presence of a large number of tables in the database, as well as forms associated with the data of these tables, greatly complicates the overall database schema. To simplify the movement between the forms of the base, create the so-called main button form. This is an ordinary element that you can edit in the designer at your discretion. We can say that by creating the main button form, you have created the database form in Access, which is its splash screen or start page.

Using the buttons placed on it, it is much easier to move between the elements, since each of the buttons is associated with a separate shape. Clicking on the button forces the DBMS to switch to the table associated with the button.

Work with the dispatcher

In Access, the creation of the main button form is carried out by a special dispatcher. The button form manager is located in the database section. If it is performed for the first time, then it will not find button forms and will offer to create one. The appeared wizard window contains several buttons from which you can select "Change." So you can go to the function of configuring the relationships of the button form and other available forms of the database.

For example, add two buttons - “Button 1” and “Button 2” - to the main button form. We will associate these buttons with the form Authors1 and Books, which is a subordinate. Selecting "Create", we will open a dialog box where we indicate the desired name of the button and the action that we need to perform ("Open the form for editing"). In the third field, specify the form with which we want to associate the button to be added.

Closing the settings window, we find that our button form has appeared in the navigation window. Selecting it in the navigation panel, open the window and see that it contains a simple design style and two buttons. Clicking on the buttons will cause the DBMS to open the form with which this button is associated.

Section with tables

In the tables section after the operations you can find an added new table called Switchboard Items. It stores all the settings data associated with the created button forms. In our case, there is only one button form with two buttons, so only three entries are placed in it:

  • records of buttons contained on the form,
  • about actions related to them,
  • record of the button form itself.

Constructor mode

The created button form can be complicated by formatting its contents in design mode. With its help, many other useful controls can be added to its surface.

Also, the main button form is the ability to associate with other similar forms. This is a useful feature for dispatching transitions between forms in a very large database, where there is room for many sections and categories.

Source: https://habr.com/ru/post/A5676/


All Articles