Как добавить существующие поля из формы в существующую таблицу в Microsoft Access - PullRequest
0 голосов
/ 03 марта 2020

Я пытаюсь добавить три поля, которые автоматически рассчитываются по форме, в существующую таблицу с еще тремя столбцами в Microsoft Access?

1 Ответ

0 голосов
/ 03 марта 2020

В мире MS Access существует два типа форм: несвязанные формы и связанные формы. Вот пример несвязанной формы.

Несвязанные формы

Let us look into Unbound Forms −

    These forms are not connected to an underlying record or data source.
    Unbound forms could be dialog boxes, switch boards, or navigation forms.
    In other words, unbound forms are typically used to navigate or interact with the database at large, as opposed to the data itself.

Связанные формы

Let us now understand what Bound Forms are −

    Bound forms are connected to some underlying data source such as a table, query, or SQL statement.
    Bound forms are what people typically think of when they think of the purpose of a form.
    Forms are to be filled out or used to enter or edit data in a database.
    Examples of bound forms will typically be what users use to enter, view or edit data in a database.

Теперь давайте рассмотрим пример несвязанной формы.

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.



The Database

The contacts database has one table called contact with the following fields:
Field Name  Data Type
cid (Primary Key)   AutoNumber
name    Text
address     Text
email   Text
occupation  Text
age     Text

Copy and paste or import the following sample data into the contact table:

1,"Axaro Dausab","255 Amite Street","ax@dausab.com","Market analyst","20"
2,"Khagu Noabes","58 Xamiseb Road","khagu@noabes.com","Medical Student","22"
3,"Dantago Nuseb","2 Nuseb Street","dan@nuseb.com","Medical Student","22"
4,"Phuna Noabeb","2 Nuseb Street","phuna@noabeb.com","Web Designer","30"
5,"Aribasen Seibeb","58 Xamiseb Road","areez@seibeb.com","Researcher","35"
6,"Zion Maletzky","58 Xamiseb Road","zion@maletzky.com","Web Designer","20"
7,"Leidago Noabeb","277 Mudi Road","leidago@noabeb.com","Web Designer","30"
8,"Amite Itheke","26 Shanke Road","am@itheke.com","Market Analyst","40"
9,"Amire Ganuseb","23 Ganuseb Road","amire@ganuseb.com","Fashion Designer","45"
10,"Dinashange Develo","40 Develo Road","dina@shange.com","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:

enter image description here

The Contact table in design view

And with sample data it should look something like this:

enter image description here

Рабочий пример можно скачать по ссылке ниже.

http://www.databasedev.co.uk/unbound-forms.html

Теперь давайте рассмотрим пример связанной формы.

To create a form with a single click,1.Open the table or query upon which you want to base the form.2.To create a form on which all fields from the underlying table or query are placed, displaying one record at a time, on the Createtab, click Form.

enter image description here

Подробнее см.

https://www.tutorialspoint.com/ms_access/ms_access_create_form.htm

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...