Database Table
Database Table object displays the selected database table on a form. Such table allows searching, filtering and selecting the connected database tables and records.
Settings
Settings tab allows selecting the connected database table.
Table group displays the currently used (active) database table. Select the database table which should be displayed in the Database table object.
Tip
Add a database by running the Step-by-Step Database Wizard or select it from the databases that have been defined using the Dynamic Data Manager.
-
Enable multiple row selection allows selecting multiple database records simultaneously.
-
Enable selection with check box: added selection check box in front of database records.
Tip
This option enhances the use of touch screen devices. Selection of multiple records becomes more user-friendly.
-
-
Show search controls option shows/hides the database search commands on the form.
-
Database search field allows you to enter search strings. If a match is found in the connected database table, the matching row is highlighted. To clear the database search field, click the erase sign which appears in the field after you enter the string.
-
Database field selector allows you to choose the fields in which the strings should be searched for. By default, all fields are selected. Check or clear the fields using the drop down list.
Note
If a match is found, the currently selected database row is set to the first row that matches the search criteria.
Note
If the queried database field is connected to another form object, this object displays the matching row data.
-
Find button starts the search.
-
-
Store selected row number to variable: stores the number of the selected table row to a variable.
Tip
If multiple rows are selected, variable stores the number of the last selected row.
Columns group allows managing the connected database table columns.
-
Style: button opens the Column style dialog window. This dialog enables the user to customize the visual appearance of a selected table column or cell.
-
Move up: button places the selected record one position higher.
-
Move down: button places the selected record one position lower.
-
Field alias: column displays the name of the table field as defined in the source database.
-
Caption: allows defining a custom column name.
-
Width: defines table column width.
-
Visible: makes the table column visible or hidden on the form.
-
Variable: variable which stores the value of a selected database record.
Note
Visibility of columns can also be defined when the form is run. Show or hide table columns using the Set object property action. Below is an example of how the form should be configured.
Example
-
Add Database Table object to the form and connect it to a database.
-
Add Button object to the form.
-
Configure the added Button object to trigger the Set object property action with a click. Set the On click event as trigger.
-
Go to Button properties > Events tab.
-
Click Actions ... to configure the Set object property action.
-
Set Object name: name of Database Table form object you wish to hide some of the columns.
-
Select the Property: Visible columns.
-
Define Value: insert comma-separated names of table columns. Use the “ character if value name includes a comma.
-
-
-
Run the form.
-
Click the button. Only selected columns are now visible in the table.
Style
Style tab defines visual appearance of the Database Object table.
-
Alignment: alignment of table header row.
-
Background color: table background color.
-
Font color: table text font color.
-
Font: table text typeface and its properties (Bold, Italic and size).
Cell style group defines visual appearance of a cell in a database table.
-
Alignment: table cell content alignment.
-
Background color: cell background color.
-
Font color: cell font and underline colors.
Font group defines the cell text font and its properties (Bold, Italic and size).
Position
Position tab defines object positioning and its position-related behavior.
Position group defines the object position.
-
X and Y: anchoring point coordinates.
-
Width and Height: horizontal and vertical object dimension.
-
Keep aspect ratio: simultaneous changing of object dimensions while scaling.
-
Lock: prevents the object from being moved during the design process.
Size group sets how object's dimensions change when the form is running:
-
Resize anchor point: defines the fixed distance of an object from the form borders.
Tip
Choose the most appropriate anchor point to ensure the object's visibility regardless of the current window size.
-
Horizontally resize with form and Vertically resize with form: object size automatically adapts to the changing size of the form.
-
Horizontally resize with form: object width adapts to the resized form.
-
Vertically resize with form: object height adapts to the resized form.
Note
If both options are enabled, object width and height adapt to the resized form simultaneously.
-
Rotation angle group sets the object angle according to the design surface.
Events
Events tab defines the actions that are run by various object-related events.
Tip
See section Actions Editor to read more about this powerful Desktop Designer tool.
Available event for Database Table object is:
-
On selection change: action is run on form startup and/or after a row (or multiple rows) is selected or deselected in the table.
General
General tab defines the object and defines object settings for form startup.
Name sets a unique object ID. It is used for object referencing when defining functions, variables, scripts, etc.
Description allows adding notes and annotations for an object.
Hint helps the form users by briefly explaining why or how to use the selected object.
Initial state on form setup group defines the object behavior while editing and printing a form:
-
Enabled: defines if the object is going to be active (editable) on the print form or not.
-
Condition: an object is enabled if the result of the given condition is "True".
-
-
Read-only: prevents connected data source input and content editing.
Tip
Read-only becomes enabled if the selected database is a "real" database. Excel database cannot be edited and is therefore read-only by definition.
-
Visible: defines if the selected object is going to appear on the form or not.
-
Condition: an object is visible if the result of the given condition is "True".
-