Home Documentation Download License Contact

Add More Tables And Fields

After creating the very simple "Clients" table, we will now see how to expand the data model by adding fields and child tables.

Adding Fields

Add some new fields to the "Clients" table. Select a new field and click on the small arrows on the top of the tree view to move it up or down. Bring the new fields in the position you wish. By default, the fields will appear in this order in the client dialog.
Right click on the "Clients" node and select "Create Table(s) and Columns" to create the new fields on the database.
NOTE: If you add fields or child tables to the "Data Model" the corresponding items will also be added to the "Access Model".

Adding Fields

Adding Child Tables To An Existing Node

Each table of the "Data Model" has a node called "Child Tables".
Right click on "Child Tables" of the "Clients" node and select "Add Child Table". A new AccessNode "Table 1" is created. Change the TableName property of this node to "Addresses" and the SingularTitle to "Address". Go on creating fields for the new "Addresses" node.
Right click on the "Addresses" and select "Create Table(s) and Columns" to create the new table and fields on the database.

Adding Child Tables

You can add more child tables to the "Clients" table node. You can also add "grandchild" tables to child tables and so on.

Adding New Tables To The Data Model

As mentioned above, adding child tables to existing "Data Model" root nodes like "Clients", will be automatically created in the "Access Model". While this is the easiest way to extend your data and access model, it restricts you to use the same table structure in these models.

Another, more flexible way to add tables, is to create a new DataRootNode in the "Data Model". This root node can be added to one or more nodes of the "Access Model". Nothing is added to the "Access Model" automatically.
At this point we will create a "Sales" DataRootNode.
Add fields to the node. For the "Sale Date" field set DataType to DateTimeData. Check SystemDateIsDefaultValue to set the current date/time by default.

Adding Root Tables

Create a new AccessModelNode on the "Sales" node.
Right click on "Child Root Nodes" and select "Add Child Table".

Adding Root Tables

Select the "Sales" data node from the dialog.

Adding Root Tables

While "Addresses" has been added as an AccessNode under child tables, "Sales" has become an AccessRootNode.
When adding an AccessRootNode, an ID field is created on the child DataRootNode, to assign the records of the child node to the parent node.
The name of this ID field is [NameOfParentNode]M4ID. In this case its "ClientsM4ID". Go to the "Sales" data node and choose again "Create Table(s) and Columns" to create the new objects on the database.

Adding Root Tables