ComputersDatabase

Access-forms. Creating forms for data entry

Access is a powerful Windows application, a database management system (DBMS ). Its purpose is to present information in a user-friendly form, automate operations that are often repeated. Also, the program helps in finding and storing data. All this is done by Access-forms. Creating forms is a simple task, designed to help the user as much as possible.

In the Access form, as in the storefront, it's easy to browse and open the items you need. Since the form is an object through 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 guarantee of the accuracy of the data and the effectiveness of working with them.

Creating forms

DBMS Access offers the user a convenient mechanism for working with data. These are special Access-forms, which greatly facilitate the input, editing and viewing of data. 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, checkboxes, radio buttons, drop-down lists and so on.

Ways to create forms in Access are diverse:

  • Form creation based on existing tables and queries;
  • Creating empty forms;
  • Separated forms;
  • Forms with several entries;
  • Subordinate Access-forms.

Forms are created using the form wizard, a special constructor.

They are especially convenient if, for example, data entry is to be done from special forms. For this, the form form, the data entry fields are specially made the same as on the form.

Forms based on an existing table

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

To print multiple table entries in the form, select the Multiple Elements button in the same section of the Create section. This way we can display a whole series of data records in the text fields of the form with all the fields of the table.

Based on the existing table, creating forms in Access also allows you to also develop a divided form. This is a view that, together with the data representation in the controls, represents a sample of data in parallel in a tabular form. To create a split form, select the "Shared form" button in the "Create" section.

Such forms appear already immediately formatted with the use of numerous controls. Most often such elements are single-line text fields, where data values stored in the fields of the table 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 only change the data of the database table records themselves, move between these records. Formatting in this mode is not allowed, and the creation of Microsoft Access forms requires the formatting of the controls and the form itself. All this can be done if you switch to layout mode or design mode.

The layout mode differs from the designer mode with less possibilities for designing forms. At the same time, it is very convenient for fast formatting, for making minor changes to the controls: vertical or horizontal alignment, adding additional text fields, changing the external style of the form, and so on. In layout mode, you can not change the data displayed in the controls, while the designer mode provides this capability.

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

Adding a button to the form

For example, you need to add a button to the form, with which you have to close it. In the designer mode, a whole layout of the various controls will be available, among which is the button. If you add it to the form layout, the DBMS automatically executes the button creation wizard, the window of which appears before the user.

The window for creating buttons will offer a choice of several categories, which contain action lists. In our case, you must select the "Work with form" category. From the list of actions of this category you need to select "Close form".

On the next, you need to inform the user that this button is responsible for closing the form. You can leave the text on the button, and you can tell about it using the icon (picture).

Next, the wizard will ask the user to give a name to the button, after which you can click "Finish" - so you get a ready button on the form that will close it.

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

It must also be said that the forms themselves can be compiled with the help of a special master. In the course of constructing a form master, you only need to determine its settings. Further, the form created by the master can easily be formatted at its discretion by switching to layout mode or design mode.

Subordinate forms

The subordinate form is an element that is the complement of the other, the main Access-form. Creating forms of submission is the development of a hierarchical design from two tables, reflecting the existence of relations between forms.

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

What is a subform

The creation of subordinate forms in Access can be explained by an example: this form can be the form of orders of a buyer in an online store.

Information about the buyer is contained in one table, and information about his orders are stored in another due to normalization in the design of the database. One buyer corresponds to several orders at once, therefore the relationship between the customer's tables and orders reflects the one-to-many relationship. In this case, the form representing the buyer's data will become the main form. Another, representing the data of his orders, will be added to the main and will be subordinate.

The main and subordinate forms located in the same layout show only related data. So, if there is a unique buyer in the buyer table, and in the subordinate table of orders there are three records associated with it, then the subordinate form will display all three records about his orders.

Form Wizard

You can create a hierarchical construction from forms in Access in different ways. For example, by implementing the script for creating both the main and the subordinate forms, you can resort to the form wizard.

Creating a master form in Access, containing a subordinate, with the help of a wizard, will not be difficult. He will not only create the forms themselves, but also connect them with the necessary attitude. If the script for creating a subform implies its addition to an existing master, then you can either use the wizard, or simply drag the existing table to the main layout and make it subordinate.

Creating forms of submission

Create subordinate forms based on two linked tables (Authors and Books). We will use the form master for this. The first step is to open the wizard itself, whose execution command is located in the Access DBMS (creating forms). In Access 2007, for example, it can be found in the drop-down list of the item "Other forms".

The opened window of the wizard will prompt you to select the table for which you want to create forms, as well as 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 link to the first one. The master will independently discover the relationship, and if he can not do it, then he can not create subordinate forms. In our case, the form created on the basis of the Books table becomes a subordinate.

In the next step, the wizard will prompt you to select the type of data representation. We need to select the "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: a tape or table layout. I must say that the tape is richer in style.

At the last step we need to configure the form headers, then click "Finish" - the subordinate access forms will be saved. Form creation is complete.

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 the forms associated with the data of these tables, greatly complicates the overall scheme of the database. To simplify the movement between the forms of the base, create the so-called main button form. This is a normal element, which you can edit in the designer at your discretion. You can say that by creating the main button form, you created a database form in Access, which is its splash screen or the start page.

With the help of 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 the button causes the DBMS to go to the table associated with the button.

Work with the dispatcher

In Access, the creation of the main button form is performed by a special dispatcher. The button manager is located in the database section. If it is performed for the first time, it will not find button buttons and will suggest creating such a button. The appeared window of the wizard contains several buttons, from which you can select "Edit". So you can go to the link setting function 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. These buttons are linked to the Authors1 and Books form, which is a subordinate. After selecting "Create", we will open a dialog box, where we will specify the desired button name and the action that we need to perform ("Open form for modification"). In the third field, we indicate the form with which we want to associate the added button.

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

Table partition

In the tables section after the performed operations, you can find the added new table named Switchboard Items. It stores all the settings data associated with the created button buttons. In our case there is only one button button with two buttons, so it contains only three entries:

  • Records about the buttons contained on the form,
  • About the actions connected with them,
  • Record about the button-shaped form.

Design mode

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

Also the main button-shaped form is the ability to connect with other similar forms. This is a useful function for dispatching transitions between forms in a very large database, where there is room for multiple sections and categories.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.delachieve.com. Theme powered by WordPress.