Laboratory work No. 5.

Subject: Creating button forms.

Target: Learn to create and edit button forms.

Exercise

Create a main button form and additional button forms for working with the database.

Basic information

SuperstructureAccessbutton form manager

Access add-ins are databases that contain procedures and their associated objects. There are three types of add-ons:

menu add-ons

· builders

· masters

Wizards and builders are context-sensitive add-ins. They are triggered when the user tries to perform certain actions. Menu add-ons are context-independent and can be accessed from the menu ServiceÞ Utilities. An example of a menu add-in is the Button Form Manager.

Pushbutton forms (or menus) ) are forms in an application that provide access to application components and subsystems. Switching between components occurs by clicking buttons. Of course, you can build button forms in design mode by creating an event handling procedure for each button Button press. But in the case where the application includes many forms and reports, this work can be very time-consuming.

Button Form Manager uses a sophisticated technique to control all button forms through one button form, creates a driver table called Button Form Elements, and allows you to create up to eight elements in each button form. If more than eight buttons are required, then the missing ones are created manually by writing procedures or creating macros. When it starts, the dispatcher looks for a table in the current database with the name SwitchboardItems, and if there is none, it starts creating a new button form.

In the dialog box Button Form Manager all forms are called pages. Here the names of all button forms of the application are specified.

In the dialog box you can change the names of forms, edit form elements (button Change...), delete elements (button Delete) or change the position of an element (button Up And Down).

In the dialog box Changing a button form element three parameters are specified:

· Text– the name of the element that will appear on the button in the button form.

· Team– the command that will be executed when the user clicks the button.

· Form– the contents of this field depend on the value of the Command field.


Rice. 5.1 . Creating a button to add a new client.

After creating the button forms, a table will appear on the Tables tab of the database window SwitchboardItems, and on the Forms tab – form Switchboard, which can be renamed. But to rename the table SwitchboardItems, you need to change all references to it in the VBA (Visual Basic for Applications) procedures stored with this button form.

Work technology

Ccreating a button form

1. Open the database.

2. Select a team Service® Utilities® Button Form Manager.



Fig.5.2 Button form Forms .

3. When asked about creating a new button form, answer Yes.

4. In the window that appears Button Form Manager click the button Create.

5. Set the name of the additional button form – Forms. Click OK.

6. Set the name in the same way Reports for the second additional button form and names Form Client And Form Orders,Report ReportClients, Account And Exit for others.

7. In the window Button Form Manager select MainSwitchboard(Main button form) and click the button Change.

8. In the window Changing a button form page click the button Create.

9. In the window Changing a button form element specify the parameters:

Text: Forms

Team: Go to button form

Form: Forms

10. Click OK.

11. Button options Reports set in the same way.

12. For the button Exit set parameters:

Text: Exit

Team: Quit the application

13. Press the button Close.

14. In the window Button Form Manager select form Forms and press the button Change.

15. In the window Changing a button form page click the button Create.

16. In the window, specify the parameters:

Text: Working with the Client form

Team: Go to button form

Shape: Shape Client

17. Click OK.

18. In the same way, specify the parameters for working with ShapeOrders

19. Provide a button to return to the Main form:

Text: Return

Team: Go to button form

Form: Main Switchboard.

20. Click Close.

21. In the window Button Form Manager choose a form Form A Client and press the button Change.

22. In the window Changing a button form page press the button Create.

23. In the window Changing a button form element specify parameters:

Text: New client

Team: Opening a form in append mode

Form: Client

24. Click OK.

25. In the window Changing a button form page press the button again Create.

26. In the window Changing a button form element specify the parameters:

Text: Editing

Team: Opening a form in edit mode

Form: Client

27. Click OK.

28. Similar to steps 21-27, create buttons for working with the form Orders

29. Similar to step 19, create a button to return to the previous form.

30. In the window Button Form Manager select form Reports, press the button Change and create button form elements Reports(view reports and return).

31. Edit the ButtonForm in design mode.

1. Topic of laboratory work.

2. Purpose of laboratory work.

3. Technology for creating a push-button form.

The main button form is created for the purpose of navigating through the database, i.e. it can be used as the main menu of the database. The elements of the main button form are form and report objects.

Queries and tables are not elements of the main button form. Therefore, you can use macros to create Query or Table buttons on a button form. First, macros “Open Query” or “Open Table” with unique names are created in the database window, and then buttons for calling these macros are created in button form.

You can create several button forms for one database. Buttons should be grouped on button form pages in such a way that it is clear to the user in which button forms certain commands can be executed (queries, reports, data entry and editing). It should be noted that subordinate button forms must have return buttons to the main button form.

The technology for creating button forms is as follows:

1) create a main button form (GKF) page;

2) create the required number of pages of subordinate push-button forms (for example, forms for data entry, for reports, for requests, etc.);

3) create elements of the main button form;

4) create elements for push-button report forms and forms for entering or changing data;

5) create macros for queries or for tables with unique names;

6) create elements for push-button query forms or tables.

The structure of button forms can be presented as follows.

To create the main button form and its elements, you need to open the database (for example, “Student Performance”) and execute the command Access Options - Settings - Select commands from / “Working with Databases” tab – select Button Form Manager and add it to the Quick Launch Toolbar Settings.

If the button form has not been created previously, a dialog box will open "Button Form Manager"

in which you need to click the “Yes” button, thereby confirming the creation of the button form. As a result, the Main Button Form page will be created.

Next, you can create three more button form pages: Data Entry Forms, Reports and Queries. To do this, click on the “Create” button and enter a name in the window that appears new page"Data entry forms"

and click on the “OK” button. The “Data Entry Forms” button form page will be created. In a similar way, you need to create two more pages, in the end we get four pages of push-button forms, which are displayed in the “Push Button Forms Manager” window.

After this, we create GCF elements; to do this, in the “Push Button Form Manager Window”, select the “Main Push Button Form” page and click “Change”, a new window “Changing Push Button Form Pages” will open.

In this window, click on the “Create” button, a new window “Changing a button form element” will open.

in which we do the following:

 enter the text: Forms for data entry;

 select the command from the drop-down list: Go to button form;

 select a push-button form from the list: Entering data into forms, click on the “OK” button.

The “Edit Pushbutton Form Page” window displays the “Data Entry Forms” button form element.

Using a similar method, you need to create the elements: “Queries” and “Reports”, and then the element (button) “Exit DB”.

As a result, all elements of the main button form will be displayed in the “Edit Button Form Page” window.

The button form appears in the list in the database window area on the Forms tab in the Objects panel, and the Switchboard Items table appears in the lists on the Tables tab. Double-clicking on the "Pushbutton Form" text will open the Main Pushbutton Form.

In order for this form to be displayed when starting the database, you must run the Access Options/Current Database command, in the View Form window, select “Push Button Form” from the drop-down list, and uncheck the Status Bar checkbox. You can also enter a title and icon for the application.

At this point, the creation of push-button forms is not yet complete, since there are no elements on the subordinate push-button forms (Data Entry Forms, Reports, Queries).

Creating Sub-Push Button Forms: Reports and Forms

To create push-button form elements "Data Entry Forms", you must launch the database (for example, "Student Progress" with the main push-button form) and execute the command Tools / Utilities / Push-button Form Manager.

The Button Form Manager window will open. Then you need to select “Data Entry Forms” in the “Push Button Forms Manager” window

and click on the Change button, the “Change button form page” dialog box will open.

in which we perform:

 enter the text: Students;

 select the command from the drop-down list: Open form for editing;

 select a button form from the list: Students, click on the “OK” button.

The "Edit Button Form Page" window displays the "Students" element. After creating the “Student Groups” element using the same technology, it will also be displayed in the window.

Next, you need to create a button to return to the main push-button form, to do this, click on the “Create” button and in the window that appears, select the command “Go to push-button form”, select “Main push-button form” and enter “Go to main push-button form”. Click on the “OK” button

and close the “Change button form page” window.

Let's launch the main button form in the database window, in which we click on the "Data Entry Forms" button, the "Data Entry Forms" will open.

The creation of elements for the “Reports” button form is carried out using the same technology, and the result will be:

Creating a Sub-ButtonForm: Queries

To create elements of the subbutton form "Queries", you need to run the database (for example, "Students' progress" with the main button form) and create macros "Open Query" or "Open Table" with unique names, and then create buttons in the button form to call these macros.

When creating a macro "Student Performance" you need to select the "Macros" tab and click on the "Create" icon, the "Macro" dialog box will open. In this window, select the "Open Query" macro action from the drop-down list and select the query name "Student Progress" from the drop-down list.

then click on the "Close" button. In the window that appears, "Save changes to the layout or structure of the Macro1 object?" Click on the "Yes" button. The “Save” window will open, in which you need to specify the name of the macro “Student Progress” and click on the “OK” button.

The macro name will be saved in the list of macros in the DB window. After creating and saving the "Parametric_query" macro, the names of the created macros will be displayed in the database window.

To create button form elements for the “Student Progress” request, you must execute the command Service / Utilities / Button Form Manager. The Button Form Manager will open.

Then you need to select “Queries” in the “Pushbutton Form Manager” window and click on the Edit button, the “Edit Pushbutton Form Page” dialog box will open.

In this window, click on the “Create” button, a new window “Changing a button form page” will open.

in which we perform:

 enter the text: Report: Student performance;

 select the command from the drop-down list: Run macro;

 select the button form from the list: Student Progress, click on the “OK” button.

The “Edit Button Form Page” window will display the “Report: Student Progress” button form element. After creating the “Parametric_query” element using the same technology, it will also be displayed in the window.

Next, close the “Change button form page” and “Push button form manager” windows. In the DB window, on the “Forms” tab, click on the “Push Button Form” inscription, and the Main Push Button Form will open. In the Main button form, click on the Requests button, and the “Requests” button form will open.

Thus, a button form "Requests" has been created, which is a subordinate button form.

A button form is a standard method of organizing the interface in applications created using MS ACCESS. A button form is a page containing buttons that allow you to open other pages, queries, dialog boxes and forms, view and print reports, and more. You can create a button form manually (using the designer) or use the function Button Form Manager .

To create a button form for working with a database Computer_mag by using Button form manager :

1. Call Button Form Manager menu command . When prompted to create a button form, click the button Yes . A dialog box will open Button Form Manager (Fig. 64).

Fig.64. Prompt to create a button form button form manager dialog box

2. With a highlighted line Main Button Form (Default) click on the button Change . In the window that opens in field Button name instead of Main button form Enter your name - Computer store(Fig. 65) and click on the button Close . Button form Computer store is now the main one for the database Computer_mag.

Fig.65. Window Changing a button form page

3. In the window Button form manager click on the button Create . A dialog box will open Creation (Fig. 66), in which you need to assign names to new pages added to the button form.

Rice. 66. Dialog window Creation new button form page

4. Enter Forms to replace the contents of the field and click on the button OK . Click the button again Create , enter Requests as the name of the new page and click on the button OK . Create a page in the same way Reports. In the dialog box Button Form Manager Three new pages will now be displayed (Figure 67).

Rice. 67. Button Pages

5. With the page highlighted, click on the button Change . In the window that opens Changing a button form page click on the button Create . A dialog box will open to create buttons on the form (Figure 68).


Rice. 68. Dialog window Changing a button form element

First field is intended for entering a label on the button. In second field a command is entered that should be executed when the button is clicked, and in third field– information (parameters) required to execute the command. All this information is stored in the button form elements table.

6. In the field Text: enter - Forms, in the second field Team: leave the value - Go to button form. In the third field Button form: click on the list pointer, select the value - Forms and click on the button OK .



Note

The label and contents of the list in the third field depend on the command selected in the second field.

7. Click the button again Create . In field Text: enter - Requests, in the field list Button form: select a value from the list Requests and click on the button OK . Similarly create a button on a button form - Reports and click on the button OK .

8. Now in the dialog box Changing a Button Form the names of the three created buttons will appear (Fig. 69).

Rice. 69. Names of buttons on the button form Computer store

9. Click the button Close to return to the window Button form manager .

Now your task is create buttons to open forms, queries and reports(they must already have been built earlier), using a button form.

10.Highlight a page Forms , and then click the button Change .

11.In the dialog box that opens Changing a button form page click on the button Create to create an element (button) on this page. Add four buttons with the following properties:

12.Now on the page Forms buttons have been created to open the above forms (Fig. 70). Click the button Close to return to the window Button Form Manager .

Rice. 70. Button form page Forms with created buttons

13.Highlight a page Reports , click on the button Change and add four buttons to this page with the following properties:

14.Click on the button Close to return to the window Button Form Manager . Click the button Close to close this window.

Note

Tables and queries can only be opened in Access using macros. Therefore, to create buttons that open queries that you created earlier, you need to use a macro.

So, to create macros to open requests in a button form, click on the object Macros in the Database Objects window. In the window that opens, you can see the macro you created earlier - View_Computers. To create a request opening macro:

1. Click on the icon Create to open the macro creation window. In field Macro command in the drop-down list, select the value - OpenRequest .

2. In a group Macro Arguments in point Request name from the opening list of requests, select – Query with parameter ; in field ModeTable ; in field Data ModeChange (Fig. 71). Close the Macro Builder window and save the created macro under the name Macro_Query with parameter.

Rice. 71. Macro builder window for opening a query

3. Following steps 1-2 above, create macros to open all your queries and name them appropriately.

Now you can return to the button form and create buttons to open queries on the page Requests. For this:

1. Click on the object Forms in the Database Objects window. Start the button form manager with the command Service|Utilities|Pushbutton Form Manager . In the dialog box that opens Button Form Manager select page Requests and click on the button Change to create buttons on this page to view all created queries. In the window that opens Changing a button form page click on the button Create .

2. To configure a button to view a request Query with parameter needed in the window fields Changing a button form element enter the required data (Fig. 72).

Rice. 72. Creating a button on a page Requests

3. Similarly, create on the page Requests buttons to open all queries you have created previously. Additionally, create a button Return to close the page Requests(see above). Now on the page Requests buttons have been created for all requests (Fig. 73). Click the button Close to return to the window Button Form Manager , in which also click on the button Close .

Rice. 73. Window Changing a button form page with created buttons

To close the button form and database you need to create on the main page Computer store corresponding buttons. But in the button form manager you can only close the form using a macro, so:

1. Create a macro to close the button form and give it a name - Closing a button form(Fig. 74).

Rice. 74. Creating a macro to close a button form

2. Launch Button Form Manager. In the window that opens, select the title of the main page of the button form and click on the button Create . In the window that opens Creation (Fig. 75) set the name of the new page of the button form - Close button form and click on the button OK . Repeat these steps again to create last page push-button form - Close database.

Rice. 75. Creating a page Close button form

Now the contents of the main page of the button form Computer store looks like in Figure 76.

Rice. 76. View of the main page of a button form Computer store

3. Next, with a dedicated page Computer Store (Default) click on the button Change . In the window that opens Changing a button form page click on the button Create to create a button that, when clicked, closes the button form.

4. In the dialog box that opens Changing a button form element in field Text: enter - Close button form. Clicking this button should close the button form.

5. Click the arrow in the box Team: and in the list of commands that opens, select – Run macro. The third field will be replaced with Macro . In the third field macro list, select – Closing a button form and click on the button OK to close the dialog box (Fig. 77) and save the changes.

Rice. 77. Window for creating a button to close a button form

6. Click the button Create to create a button to close the database. In the window that opens (Fig. 78) in the field Text: enter - Close database, in field Team: enter - Quit the application and click on the button OK .

Rice. 78. Window for creating a button to close the database

7. Now the main page of the button form Computer store will contain all the necessary buttons (Fig. 80). Click on the buttons one by one Close in the windows Changing a button form page And Button Form Manager.

Rice. 80. Home page push-button Computer store

8. The created button form can be edited like any other form in design mode (change title, color, font, background, add a picture, etc.). To do this, on the Access toolbar, click the button View to display the button form in design mode. Edit the created form (Fig. 81) and close the window.

Rice. 81. Form designer window for editing a button form

9. Next, on the object panel of the database window, click Forms, and then in the list of forms, double-click Button form. The main button form window will open. Computer store(Fig. 82).

Rice. 82. Push Button Window Computer store

10. Check the operation of all buttons on the button form. Open the pages one by one Forms, Queries, Reports and check that all database objects are opened correctly. In case of failures or errors, edit the contents of the button form.

11. Close the button form window.

Note

You can modify the button form by opening Button Form Manager to add pages and commands, or use Design view to add pictures and other objects. Since everything necessary for the functioning of a button form is stored in itself and in the corresponding element table, you can copy or import the button form and element table into any database that requires a similar button form, modifying it, if necessary, using the button form manager.

Creating a Button Form

When opening the database, the following form should appear on the screen: Database “Products” (Title Page) (Fig. 1.).

Rice.

By clicking the Exit button, the database should be closed.

When you click on the Database button, the Main button form should be displayed on the screen, the buttons of which open second-level forms (Fig. 2).

Rice.

Operating procedure:

  • 1. Creating the structure of the main button form begins with button forms of the second level: Tables, Forms, Queries, Reports. Let's look at this process using the Table form as an example.
  • 1.1. On the Create tab, in the Forms section, click the Blank Form button. A form will appear on the screen. not associated with any table. The form opens in Design mode (Fig. 3).

Rice.

1.2. On the Design tab, in the Tools section, click the Property Page button. In the properties window, on the Layout tab, in the Signature line, write the name of the form (Fig. 6.4).

Rice.

  • 1.3. The Selection Area and Navigation Buttons are removed from the form (these parameters are configured on the Layout tab of the Properties Window).
  • 1.4. On the Design tab, in the Controls section, all objects are displayed and the Use Wizard button is disabled (made inactive) (Fig. 5).

Rice.

1.5. Buttons are “drawn” on the form; when clicked, tables will open. The number of buttons should match the number of database tables plus a button to close the form and return to the main menu (Fig. 6).

Rice.

  • 1.6. For each button, a command is written that will open the corresponding table.
  • 1.6.1. To do this, select the button and on the Design tab, in the Tools section, select Property Page.
  • 1.6.2. In the dialog box that appears, go to the Events tab and place the cursor in the Button Press line.
  • 1.6.3. A button will be displayed on the right side of the line; when you click on it, the Builder dialog box will appear on the screen, where you select the Macros command and click the OK button.
  • 1.6.4. A window designed for recording macro commands will appear on the screen (Fig. 7).

Rice.

1.6.6. In the Add new macro command line, select the OpenTable command. In the Macro Arguments section, select the name of the table to open and the opening mode from the drop-down list.


Rice. 6.8. Selecting a table name and opening mode

  • 1.6. The macro recorder window closes. To check how the macro works, you need to switch from Design mode to Forms mode and click on the created button. The corresponding table should appear on the screen.
  • 1.6.8. Similar commands are written for the remaining buttons with the only difference that in the Table Name line the name of another table will be indicated - Product Directory, Invoice Directory or Goods Receipt.
  • 1. Record a macro for the button Go to the main button form, which will allow you to close the Table form and open the Main Menu form.

To do this, you need to write down the following sequence of commands in the macro recorder window (Fig. 9).


Rice.

1.8. In a similar way, the forms “FORMS”, “QUESTS”, “REPORTS” are created, containing the corresponding buttons (Fig. 6.2).

In this case, all forms should be opened in Forms mode, reports in View mode, and queries in Design mode.

  • 2. The first level form, the Main button form, is created.
  • 2.1. On the Create tab, in the Forms section, click the Blank Form button. A form will appear on the screen that is not associated with any table. The form opens in Design mode (Fig. 10).

Rice.

2.2. On the Design tab, in the Tools section, click the Property Page button. In the properties window, on the Layout tab, in the Signature line, write the name of the form (Fig. 11).


Rice.

  • 2.3. The Selection Area and Navigation Buttons are removed from the form (these parameters are configured on the Layout tab).
  • 2.4. On the Design tab, in the Controls section, all objects are displayed and the Use Wizard button is disabled (made inactive) (Fig. 12).

Rice.

  • 2.5. Buttons are drawn on the form, clicking on which will open second-level forms: Tables, Forms, Queries, Reports, as well as a button to go to the title page of the “Products” Database (Fig. 13).
  • 2.6. For each button, a macro is created containing commands that must be executed when the button is pressed (Fig. 14, 15).

Rice.

Rice.

  • a) macro command for the Open TABLE form button;
  • b) macro command for the button Open form FORMS;
  • c) macro command for the button Open the REQUESTS form;
  • d) macro command for the button Open the REPORTS form
  • 3. Creating the Title Page form.
  • 3.1. On the Create tab, in the Forms section, click the Blank Form button. A form will appear on the screen that is not associated with any table. The form opens in Design mode.
  • 3.2. On the Design tab, in the Tools section, click the Property Page button. In the properties window, on the Layout tab, in the Signature line, write the name of the form (Fig. 16).

Rice.

  • 3.3. The Selection Area and Navigation Buttons are removed from the form (these parameters are configured on the Layout tab).
  • 3.4. On the Design tab, in the Controls section, all objects are displayed and the Wizard button is disabled (made inactive) (Fig. 17).

Rice.

3.5. A Tab () is drawn on the form (Fig. 18).

Rice.

3.6. Tab labels contain their names. To do this, select the required tab and call it context menu, select the Properties command and change the Signature property (Fig. 19).


Rice.

3. The “Main page” of the “Products” Database form is created (Fig. 20).

Rice.

Note: if the dimensions of the photo exceed the dimensions of the frame, then you need to open the Properties window for the picture and in the Set dimensions line, select the Fit to frame command.

3.8. The “Initial Information” page is created (Fig. 21).

Rice.

3.9. In the note of the Title Page form, two buttons are created, designed to close the database and to go to the main button form (Fig. 22).

Rice.

  • 3.10. For each button, a macro is created with the corresponding commands (Fig. 23).
  • a) for the Database button:

b) for the Exit button:


Rice.

3.11. On the Main push-button form, a button is created, clicking on which will open the Database “Products” form and close the Main push-button form (Fig. 24, 25).

Rice.

Rice.

3.12. Set so that when you open the database, the “Products” Database form automatically appears on the screen. To do this, select the File tab, Options command, Current Database section and in the View Form line select the name of the form Database “Products” (Fig. 26).


Rice.

push-button interface signature

Bibliography

  • 1. Fomina E.E. Guidelines for implementation course work in the discipline "Informatics" [ Electronic resource]: methodological manual / E.E. Fomina. Tver, 2009. 102 p.
  • 2. Mamontova E.A., Tsvetkova O.N., Grigoriev S.M. Working with databases in MS Access 2010: guidelines and assignments for studying the course “Informatics”, “Economic Informatics” / E.A. Mamontova, O.N. Tsvetkova, S.M. Grigoriev. Moscow, 2012. 75 p.
  • 3. Vinogradov G.P., Kirsanova N.V. Designing the structure of relational databases using MS Access DBMS: tutorial/ G.P. Vinogradov, N.V. Kirsanova. Tver: TSTU, 2006. 84 p.

In this lesson, the user will learn what form creation capabilities the mode offers Constructor, will see how to add controls to a form, and will also look at how to create a main button form that will allow you to combine forms from different tables with each other.

Topic: Technologies for searching and storing information

Lesson: Creating the main button form and controls

In the previous lesson we looked at the mode of working with forms Layout. There is another mode for working with forms, it is called Constructor. In this mode, we can place additional elements on the form, the so-called controls or dialog box elements. These are well-known elements to us: buttons, lists, list boxes. We can create all these elements in the mode Constructor.

As soon as we go into mode Constructor form, a tab immediately appears on the ribbon Constructor, and on it we will see all the controls available to us (Fig. 1). It is these elements that we can place on forms.

Rice. 1

Let's see how we can add these elements to the form in practice. To do this, let's go to Design mode (Fig. 2), then the Design tab will automatically appear on the ribbon, and we will see all the available elements (Fig. 1).

Let's select an element button(Fig. 3), right-click on it and mark the dimensions of the future button on the form (Fig. 4). A button creation dialog box will automatically appear where we can select a category and action (Fig. 5). For example, find the entry, and click Next. On the button we can place either text or the corresponding standard image or the overview icon (Fig. 6). Let's click next and we will see that the next step is to set the name of the button, after which we click Finish (Fig. 7). The button has appeared, we can adjust the dimensions and switch to the mode Form in order to see how the button will be reflected on the form and try out its action (Fig. 8). Let's click on it; yes, indeed, as it should have been, a window appeared Search and replace(Fig. 9). Let the surname Blok be the example, let the search be carried out in the category “museum-apartments of St. Petersburg”, let the match be in any part of the field and look through all records (Fig. 10). Let's click next, the button actually works correctly, and the information we need is found in the table (Fig. 11).

Rice. 2

Rice. 3

Rice. 4

Rice. 5

Rice. 6

Rice. 7

Rice. 8

Rice. 9

Rice. 10

Rice. eleven

In addition to command buttons, you can also place lists on the form. Selecting from a list provides faster access to the desired entry. Let's see how you can create a drop-down list on a form.

Let's create another control on the form and switch to the mode Constructor and select the control Combo box(Fig. 12), let us designate its location and dimensions (Fig. 13). After this a dialog box will appear Creating Combo Boxes, in which we can choose how the combo box will receive the value, select, for example, the third option and click next (Fig. 14). Let's select a field Name and click Next (Fig. 15) and Finish. But we see that the title field already existed, it turned out to be an overlay, but we can simply delete the second title. Let's switch to mode Form, to try out the list. The list opens, we select a name museum-apartment A.S. Pushkin(Fig. 16) and we see that there is a transition to her picture (Fig. 17). That is, the combo box works.

Rice. 12

Rice. 13

Rice. 14

Rice. 15

Rice. 16

Rice. 17

If there is not one table in the database, but several and, accordingly, several forms, then you can create main button form, containing buttons, and by clicking on the buttons we can load a particular form.

Let's look at the steps involved in creating the main button form.

If the database has several tables and a corresponding number of forms, then it makes sense to create a main button form, which will serve as a kind of screen saver for the database in which all other forms can be loaded. Click on the tab on the ribbon Working with databases(Fig. 18), select the button form manager command there, and the message appears: Cannot find the button form in this database, so we press the button Create(Fig. 19). A dialog box will appear Button Form Manager, in which we can select the command Change, a window will appear Changing a button form page. Let's create the first button on it (Fig. 20). Let the text of this button be museum apartments and the command will be executed Open form for modification, and the form is . Let's create another button, which we'll call writers, when clicked the command will also be executed Open form for modification and shape writers(Fig. 21). Let's close the open dialog boxes, and we will see in the list of objects that new forms and corresponding tables have appeared (Fig. 22).

Let's open the button form. By default, it has this design (Fig. 23), there are two buttons on it, when you click on the first button, you go to the form museum-apartments of St. Petersburg, by clicking on the second one we will open the form writers, i.e. the button form works correctly. Now let's try to change its standard design, go to the mode Constructor, and we will see the properties window here. Thus, we can select any of the elements and change, for example, the background color (Fig. 24). And then we can place, for example, an image (Fig. 25). To do this, select an arbitrary image on our computer and go to the mode Form. Now our main button form has taken the following form (Fig. 26). You may not necessarily have an image of a computer, but the drawing that you chose at the previous stage. We can note that our design has changed for the better.

Rice. 18

Rice. 19

Rice. 20

Rice. 21

Rice. 22

Rice. 23

Rice. 24

Rice. 25

Rice. 26

Bibliography

  1. Ugrinovich N.D. Computer science-9. - M.: BINOM. Knowledge Laboratory, 2012.
  2. Gein A.G., Yunerman N.A. Computer science-9. - M.: Education, 2012.
  3. Solovyova L.F. Computer Science and ICT. Textbook for 9th grade. - St. Petersburg: BHV-Petersburg, 2007.
  1. Lessons-tva.info().
  2. Office.microsoft.com().
  3. Lessons-tva.info().

Homework

  1. What operating modes does the Form object support?
  2. How to add controls to a form in MS Access?
  3. What is the main button form?
  4. Is it possible to visually edit forms?