Help Menu

KaioneSoft Home

Help Home

Index

Glossary

Conventions

Introduction

Installation

Getting Started

SprintDB Pro 2

Desktop Companion

Using Tables

Creating SQL

Creating Forms »

How to

Advanced Techniques

Understanding Macros

Macro Actions

Database Functions

Tutorial

UI Design Guide

New Features

Creating Forms and Controls         Reference Section

Overview

In SprintDB, forms are the basis of all database applications. The Form is the container for all the controls (e.g. edit boxes, buttons, etc.) you use in creating an application.

This section outlines the basic steps required to create a SprintDB Pro form, however, the best way to learn about Form creation is to follow the detailed description in the Tutorial.

Form Creation Index

Form

Controls

Creating a Default Form

Adding Bound Controls

Setting Control Properties

Creating Controls

Setting the Record Source

Importing and Exporting Forms

Adding SubForms

Form Creation Basics

To create a Form, use the following steps:

  1. Open the Database you require the form to access.
  2. Tap the Form tab.
  3. Tap the New button. This opens the "Record Source" dialog form.
  4. Use the Dropdown box to select a Table in the database or a saved Query.
  5. Tap the Ok button to continue.

Creating a Default Form

The preceding steps create the Form. The next step is set the Form's properties or Tools > Create Default Form. Selecting this option will automatically create a Bound Control EditBox and a Label for each control, based on the Field name of each field. A Record Counter will also be created.

This is the fastest way to create a SprintDB Pro Form. As soon as the Default Form has been created you will have access to your table. Run the form by tapping File > Run. You can then use the standard "Record Navigation" controls and the Form Scrolling buttons.

Setting the Form Properties

There are four Tabs in the Form Properties window; these are listed below .

To set the Properties for the Form, tap the Tools > Form Properties. menu item. 

The Basic Properties:

  • Name: Set a name for the form.
  • AutoRun: Choose whether the Form will run automatically when you open your database.
  • Color: The background color of the form.
  • Font: The Form's default font. This becomes the default font for all the controls on your Form. 
  • ClearTypeFont: Choose whether the Form use ClearType font.
  • DeleteConfirm: The DeleteConfirm allows you to enable/disable Delete Confirmation before record deletion.
  • InputPanel: The InputPanel setting allows you to raise the Pocket PC's Software Keyboard when the Form is opened. 
  • H.ScrollBar/V.ScrollBar: Determine whether the entire Form has a horizontaol and vertical scroll bar, allowing the user to scroll to view controls that are not visible.
  • EditPassword: Allows you to set a password to restrict access to the Form. This prevents anyone who doesn't know the password from editing the Form.
  • OpenPassword: This prevents anyone who doesn't know the password from running the Form.
  • BkGroundImage: Specifies a bmp or jpg graphic to be displayed as a background picture on the form.
  • Stretch: Specifies how a picture is sized.
    • Stretch: The image resizes to fit the control, but does not maintain its original proportions.

    • Zoom: The image resizes to fit the control while maintaining its original proportions.

  • CommandBar: Allows you to show/hide record navigation buttons on the form when running the form.

  • FormMenu: Allows you to show/hide form menu when running the form.

  • AllowEdits: Specifies whether a user can edit saved records when using the form.

  • AllowDeletions: Specifies whether a user can delete records when using the form.

  • AllowAdditions: Specifies whether a user can add a record when using the form.

The Data Properties:

  • Form: Choose a Main/SubForm you want to specify the record source for.
  • InUse: Specifies whether the selected Main/SubForm is used on your form.
  • RecordSource: Specifies the source of the data for the selected Main/SubForm. The RecordSource property setting can be a table name, a query name, or an SQL statement.

 

The Event Properties:

See Understanding Macros for details on building Events.

  • Form: This allows you to choose the Main or SubForm the events will operate on. Select the one from the list.
  • OnOpen: The OnOpen events occur when the Form is opened but before the first record is displayed.
  • OnActivate: The OnActivate events occur when the Form becomes the active window.
  • OnDeactivate: The OnDeactivate events occur when the Form loses the focus. 
  • OnClose: The OnClose events occur when the Form is Closed. 
  • OnCurrent: The OnCurrent events occur when the focus moves to a record, making it the current record.
  • OnUpdate: The OnUpdate events occur when you move to another record or close the form if the current record has been updated.
  • OnAdd: The OnAdd events occur after a new record is added. 
  • OnDelete: The OnDelete events occur before the record is deleted. 
  • OnClick: The OnClick event occurs when you click a blank area of the form.
  • OnTimer: The Timer event occurs for a form at regular intervals if any timer specified by the SetTimer() macro action.
  • OnInputPanelOn/OnInputPanelOff: The OnInputPanelOn/OnInputPanelOff events occur when you raise/lower the Software Input Panel.
  • OnPaint: The OnPaint event occurs when SprintDB repaint the form.

<Index>

Form Macros

This is where you create Form Macros that the form can access through its form/control event code. To call a form macro, use the CallMacro() macro action.

You can assign up to 5 Macros, numbered 1 to 5.

  • Tap the Macro field to open the Event Builder.
  • Construct your Macro
  • Tap the OK button to save your work

See Understanding Macros for a detailed description.

Adding Bound Controls

A bound control is tied to a field in an underlying table or query. You can add a new bound control to your form at any time.

  1. Tap the Insert menu > New BoundControl
  2. You will then be able to Select the Table, Field and Control Type required.
  3. If you check the +Label checkbox, SpintDB Pro will automatcally add a Label control containing the Fieldname to the left of the selected control.
  4. Tap the OK button the complete the process.

<Index>

Creating Controls

You can create any of the following Unbound controls:

To create any of the above, tap the Insert menu and select the type of control required. Then tap on the Form in roughly the position where you want to place the button. Place the control by tapping and holding it with the stylus and dragging it into position. Use the Control Navigation buttons to fine tune the placement.

See also How to work with Controls.

SubForms

A SubForm is a collection of controls that have an alternative record source that can be related to the record source of the MainForm.

A SubForm is a form within a form. The primary form is called the Main Form, and the form within the form is called the subform. A Form/SubForm combination is often referred to as a hierarchical form, a parent/child form. Sub forms are especially effective when you want to show data from tables or queries with a one-to-many-relationship. For these types of subforms, you should specify its record source properly to synchronize it with its master form.

You can also insert a subform which will not synchronize with any Master form. This type of subform has no parent form. You can specify its RecordSource in event procedures by using SetFormSource() macro action which will be executed at run-time.

For a detailed explanation of SubForms, please refer to the Glossary.

Adding a child subform

  1. Tap the Tools > Form Properties menu item
  2. Tap the Data tab.
  3. Tap the Form Dropdown box and select a SubForm from the list. You can assign up to 5 Sub forms.
  4. Check the InUse field to "Yes".
  5. From the RecordSource Dropdown box, select an existing table or saved query. To enter a new SQL statement, tap the Ellipsis [...] button.
  6. Specify its MasterFrom from the MasterForm list.
  7. For these types of subforms, you should specify its record source properly to synchronize it with its master form.

For example
The record source of the master form:
"SELECT * FROM
Orders"
The record source of the child form(subform):
"SELECT * FROM
OrderDetail WHERE OrderDetail.OrderID=!0!Orders.OrderID"


Note: !0! refers to MainForm, and !1! refers to SubForm1 and !n! means n-th SubForm.

Removing a child subform

Note: Make sure the selected SubForm is the one you want to delete as all the controls on it will be deleted as well. There is no undo function.

  1. Tap Tools > Remove SubForm
  2. Select the SubForm you want to delete from the list
  3. Tap Yes to proceed or No to cancel the operation

Related Topics

How To
Using Macros

<Index>

Importing and Exporting Forms

Exporting a form saves the Form as a individual form file(.pfs).

  1. Open a form you want to import in edit mode
  2. Tap File > Export form, then enter an appropriate name for the .pfs file.

This feature is useful when you send a form only to other users of SprintDB Pro.

<Index>