Title: Chapter 6: Creating Custom Forms
1Chapter 6 Creating Custom Forms
2Lesson C Objectives
- After completing this lesson, you should be able
to - Convert data blocks to control blocks
- Link data blocks to control blocks
- Create a form that has multiple canvases
- Create tab canvases
- Create stacked canvases
3Converting a Data Block to a Control Block
- Use Data Block and Layout Wizards to create data
block form and form layout - Convert data block to control block
- Add command buttons to control form processing
- Simplify creation of control blocks
4Converting a Data Block to a Control Block
(continued)
- To convert data block to control block
- Change data blocks Database Data Block property
value to No - Change Required property value of text item that
represents data block tables primary key to No
5Linking a Data Block to a Control Block
- Create forms that link data blocks and control
blocks to work together - Usually represent master-detail relationship
6Creating the Data Block
- Use Data Block Wizard and Layout Wizards
- To create and configure data block
- Must contain field that links it to control block
- Create data block without master-detail
relationship - Link two blocks later
7Linking the Control Block and the Data Block
- Open detail data blocks Property Palette
- Modify data blocks WHERE Clause property
- General syntax
- fieldname control_block.text_item_name
8Refreshing the Data Block Values
- Add commands to
- Initially populate data block display
- Periodically refresh data block records
- Use the GO_BLOCK built-in
- To move form focus to data block
- Then execute EXECUTE_QUERY built-in
- Flushes block
- Makes information consistent with corresponding
database data
9Creating Forms with Multiple Canvases
- Good practice not to show too much information on
users screen display - Single-form approach
- Create one form with multiple canvases
- Enables form to share data among different
canvases - Impossible for multiple programmers to work
simultaneously on different canvases of same
application
10Creating Forms with Multiple Canvases (continued)
- Multiple-form approach
- Create multiple forms with different .fmb file
for each application canvas - Works well when multiple programmers collaborate
to create complex application - Enables programmers to use form in many different
applications - More difficult for related forms to share data
11The Northwoods University Student Services Process
- Identify sequence of actions that user will
employ to interact with canvases
12Interface Design
- Student Log On canvas
- Menu canvas
- Student Information canvas
- Course Grades canvas
- Enrollment canvas
13Working with Multiple Canvases and Data Blocks
- Create form that contains multiple canvases
- Create individual canvases
- Specify to display specific block items on
specific canvas - Create new data block
- Select canvas name on which block items appear
- On Layout Wizard Canvas page
14Working with Multiple Canvases and Data Blocks
(continued)
- Often forms that have multiple canvases also have
multiple data blocks - Group items that appear on same canvas in single
data block - To keep blocks small and manageable
- Cannot create two items that have same name in
same data block - Ensure that Forms Builder places new items in
correct block
15Specifying the Block Navigation Order
- Specify which canvas initially appears when user
runs form - Canvas whose block items appear first under Data
Blocks node in Object Navigator window - Order of canvases in Object Navigator Canvases
list does not matter - Only order of data blocks
16Object Navigator
17Referencing Different Canvases, Form Blocks, and
Block Items
- All form items have Canvas property
- Specifies name of canvas on which item appears
- Form always displays canvas on which item with
focus appears - Execute GO_ITEM built-in
- Move form focus to item on target canvas
- Good practice to include block name
18Creating and Configuring Tab Canvases in Forms
- Tab canvases
- Multiple-page canvases
- Allow users to move between multiple canvas
surfaces - By selecting tabs at top of canvas
- Display large number of related items in modular
way - Direct user through sequence of steps for
performing task
19Creating a Tab Canvas
- Contains two or more tab pages
- Tab page
- Object representing surface
- Displays form items
- Has tab label identifier at top
20Creating a Tab Canvas (continued)
- Create form that contains tab canvas
- Create form
- Create new content canvas in form
- Create tab canvas on content canvas
- Configure tab pages
21Creating Form Items on a Tab Canvas
- Use tab pages as any content canvas
- Create items on tab pages
- Using Data Block Wizard
- By creating control block and drawing text items
directly on tab canvases - Must be sure to specify placement of items on tab
canvas
22Lesson C Summary
- Convert data block to control block
- Create relationship between control block and
data block - Display information on multiple canvases
- Single-form approach
- Multiple-form approach
- Tab canvas
- Multiple-page canvas
23Summary
- Custom form
- Runtime errors
- Forms Debugger
- Form triggers
- Create custom messages and alerts
- Validate user inputs
24Summary (continued)
- Convert a data block to a control block
- Create relationship between control block and
data block - Display information on multiple canvases
- Tab canvas