Contents 

Fast Start
Weight Scale Interfacing (Digi D770)
What Is Visual Builder?
What's New In Visual Builder?
Creating A CAPITAL Form
Creating a Form - Conceptual Overview
Creating a Form - Quick Guide For Advanced Users
The Forms Wizard
Creating A CAPITAL Report
The Label Wizard
Report Wizard Tutorial
New & Revised Topics in CAPITAL 7.5
AllocatePayment()
CrossTab()
CreateTable()
EventAdd()
FilterTable()
Find()
PayMethodName()
ReadINI()
SendHTMLMail()
TranInfo()
WriteNote()
New & Revised Topics in CAPITAL 7.41
AddPayment()
Business Functions Listing
BufferCommit()
BufferRollBack()
BufferUpdates()
ExportASCII()
GetFolder()
KitList()
LockRecord()
ReadNote()
ReadTextFile()
StockQuantity()
StrWrap()
WriteTextFile()
New & Revised Topics in CAPITAL 7.4
Business Functions Listing
CompanyName()
Department()
Field Objects
JobInfo()
Linking
Moving & Resizing Body Objects
Operators & Expressions
OrderTable()
PathData()
Picture Object Properties
ReadINI()
ReadNote()
RunApplication()
Sample Scripts
Send Product Info Email With Pictures
Start-up Switches
StockAnalysis()
TagInfo()
TranWrite()
WriteINI()
New & Revised Topics in CAPITAL 7.3
AddStock()
AddTraceProperty()
BackAllocate()
Business Functions Listing
CardFileBill()
ComError()
ComClose()
ComOpen()
ComRead()
ComSetup()
ComWrite()
ComputerName()
EchoBox()
EchoBoxOn()
EchoBoxOff()
LockSemaphore()
PasswordInfo()
ScriptRun()
TodoAdd()
Trouble-Shooting Guide
UnlockSemaphore()
New & Revised Topics in CAPITAL 7.2
Business Functions Listing
ImportASCII()
Journal()
ReadNote()
StockGetQuantity()
StockQuantity()
TimeFormat()
Version()
Basic Editing
Moving & Resizing Objects
Moving & Resizing Body Objects
Creating Forms & Reports
Form Bodies
Form Design Hints & Tips
Body Properties
Body Contents
Rule Wizard
Rule Wizard Guidelines
Body Rules
Group Wizard
Body Groups & Totals
Form Output Properties
Form Notes
Question Wizard
Form Question Prompt
Form Questions
Preface and Postscript Scripts
Form Dictionaries
Page Setup
Form Editor Preferences
Field Objects
Field Formulas
Bar Code Field Objects
Text Object Properties
Picture Object Properties
Linking
Why are Table Joins Necessary?
Linking Forms - Concepts
Linking Forms - Tutorial
Linking Forms - Hints & Problem Solver
Special Topics
CAPITAL Data Browser
Bar Codes - An Overview
Cross-Tab Concepts
Cross-Tabs
Cross Tab Fields
Cross-Tab Hints & Tips
Exporting Data
Printing
Transaction (Form) Printing
The Print Job Manager
Windows Printing Concepts
Script Programming
Business Functions Listing
Capital Business Script
Variables & Data Types
Scope
Operators & Expressions
Type Conversion
Business Functions Overview
Commands
CALL
DEBUG
GOTO (label)
IF (expression) GOTO
IF (expression) ... ELSE ... ENDIF
PAUSE
REM (*)
RETURN
Visual Forms Builder Special Variables
Sample Scripts
Sending Email Using CBS
Programmer's Frequently Asked Questions
Business Functions
AAdd()
Abs()
AddCustomer()
AddJobCard()
AddMail()
AddPayment()
AddRecord()
AddStock()
AddTraceProperty()
AllocatePayment()
Alltrim()
AnswerYes()
ArraySort()
Asc()
AsChar()
ASIZE()
AsTran()
AsVal()
AT()
BackAllocate()
BPayCRN()
BPayError()
BufferCommit()
BufferRollBack()
BufferUpdates()
CDOW()
Ceil()
CHR()
CloseFile()
CloseIndex()
CloseTable()
CMONTH()
CompanyName()
CompressTable()
ComError()
ComClose()
ComOpen()
ComRead()
ComSetup()
ComWrite()
ComputerName()
CopyFile()
CopyRecord()
CopyToClipBoard()
CreateFile()
CreateEmailJob()
CreatePrintJob()
CreateTable()
CrossTab()
CTOD()
DateFormat()
DateFromMonth()
DAY()
Dictionary()
DOW()
DTOC()
DTOS()
Echo()
EchoBox()
EchoBoxOff()
EchoBoxOn()
EchoStatus()
Eof()
EraseFile()
EventAdd()
ExpenseAnalysis()
ExportASCII()
FilterTable()
Find()
FindWindow()
ForDate()
FormAdd()
FormResult()
FreeCPU()
FormCreate()
FormShow()
GetField()
GetFolder()
Goto()
GotoBottom()
GotoTop()
HoldRecord()
GroupChange()
Idle()
IF()
ImportASCII()
IndexTable()
Input()
InputFile()
INT()
IsEmpty()
IsFile()
IsFileEnd()
IsLayBy()
IsPaid()
IsPayment()
JobInfo()
JobPriority()
JobStatus()
KitList()
LEFT()
LEN()
LockRecord()
LOWER()
LTRIM()
Max()
Min()
ModemDial()
Month()
MonthEnd()
MonthStart()
NTrim()
NumToWord()
OpenFile()
OpenTable()
OrderTable()
OpenVisualBuilder()
Pad()
PathCompany()
PathProgram()
PayMethodName()
PostMessage()
PriceUpdate
RAT()
ReadFile()
ReadNote()
ReadFileLine()
ReadTextFile()
RecNo()
RenameFile()
Replicate()
Right()
Round()
Rtrim()
RunApplication()
Seconds()
Security()
SendDirect()
SendMail()
SendEscapeCodes()
SendMail()
Shell()
Skip()
Space()
SpecialName()
SpecialPrice()
SQRT()
StockAnalysis()
StockDescription()
StockMovement()
StockPrice()
StockId()
StockQuantity()
Str()
StrLine()
StrLineCount()
Strtran()
StrWrap()
Substr()
StrZero()
Time()
Today()
TodoAdd()
TranAdd()
TranCreate()
TranWrite()
TranInc()
Transform()
TranStr()
Type()
UnlockRecord()
Unpaid()
Upper()
UserName()
UserNumber()
Version()
WaitCursor()
WaitFile()
Week()
Write()
WriteFile()
WriteFileLine()
WriteNote()
WriteTextFile()
Year()
ZipFile()
Tutorials
Report Wizard Tutorial (Basic)
Label Wizard Tutorial (Advanced)
Forms Library
The Visual Builder Report & Forms Library
Forms Stationary
Report Library - Customer Transactions
Report Library - Cash Management
Report Library - Sales Analysis
Report Library - Sales Orders & Back Orders
Report Library - Stock Control
Report Library - Service Management & Periodic Billing
Report Library - Special
Appendix
Moving Forms
Logging On
Overriding Print Warning Messages
Questions & Answers
Start-up Switches
Trouble-Shooting Guide
Weight Scale Interfacing (Digi D770)
Working With Text Printers

CAPITAL Series 7 Visual Builder Reference Guide

Prev Page Next Page

Linking Forms generate/tab1c11.gif generate/en74.gif


This dialog allows you to specify which tables of data will be available for display on the form.

Main

The main or central table that this section of the form will be focused on. Click on the down arrow of the control to list all tables currently available for selection.

generate/notepad.gifYou may also specify a character variable that contains the name of a database to open. If you wish to specify a variable name surround the variable with double quotes. E.g., "TableName"

Step

This selection determines movement through the main table once the table has been opened, ordered and positioned. (Ordering is determined by the Sort entry, and initial positioning by the Seek entry.) The default behaviour is to move forward through the list of entries in the main table until the end of the table is reached or a rule that terminates further forward movement is evaluated as TRUE. You may override the default behaviour by specifying "Backward". Display of the report will then terminate when the beginning of the table is reached, or a rule that terminates further backward movement is evaluated as TRUE.

Sort

Enter an expression to sort on or select from the pre-defined list of sort expressions by clicking on the down arrow. If a sort order is not specified the table will be displayed in "natural order", or in other words, in the order in which the data was entered.

Note that if you enter your own sort expression rather than select one from the list, CAPITAL will have to physically sort the report before printing it. This may take anywhere from a few seconds to several hours to perform, depending on the speed of your computer and the size of the database that must be sorted.

Hints & Tips

It is generally okay to specify your own sort expressions when you are running a report that will be executed infrequently. For example, once per day, week or month. Sort expressions should usually be avoided if you will be printing the form continuously. For example, a custom sort expression would not be recommended for an "invoice" which needs to be printed quickly and frequently.

Seek

Enter a field, variable or suitable expression that will be used to position the Main table, the first time information from this body form is displayed. Seek expressions are optional.

If you have joined a body to either a parent or another body, the body will be positioned automatically and there is no need to enter a Seek expression. When this occurs the Seek expression edit control will appear disabled.

Join

Select this option when you want a body form to be automatically joined to the "parent" or main section of the form/report or another body form. The following condition must be met:

The Sort expression of the destination join must be of the same type as the body form Sort expression. For example, if the Sort expression of the parent is a number, and the Sort expression of the body form is a character string, then automatic linking will not be attempted and a warning message will be displayed.

See the following diagram:

 

generate/vb2.gif

Keep in mind the following points:

  • Body forms can be joined to the main form or each other. The main form cannot be joined to anything as it is the starting point for all joins.

  • A body form joined to itself does nothing.

  • When joining to a parent: When an automatic join is in place, only the records that match the Seek expression from the Main parent form will be included in the sub/body form. To use the Invoice example again, if you have an expression that evaluates to the invoice number 1000 in the Main parent table, then only records in the stock sales database that also match 1000 will be listed on the form. See the following diagram which illustrates this relationship:

generate/vb3.gif

  • When joining a body to another body: When you have joined one body to another, the joined body takes on the next record position of the body it is joined to. This is very useful if you wish to create a set of labels on a page. Each body is used to represent a label. If the bodies are joined together, they will each print the next record/label data. Joining a body to another body is only meaningful when both bodies share the same Main table.

Nearest Match

The form will evaluate the expression entered in the Seek field (if any) and move to the first record that exactly matches this expression. If there is no exact match, no records will be included on the form.

You may allow the form to find the next closest match by selecting this option. If the Seek expression is looking for the date 01/01/99 and the next available date is 05/01/99, then this record will become the starting record for display. Likewise, if the Seek expression is trying to locate transaction number 1000, but the next closed number is 1002, then 1002 will be located instead.

Database + Key

You may link or join other databases that are related to the Main database here. Enter the database name, then -> followed by the key. Click on the table list to display a pre-defined list of keys that you may choice from. Most, but not all databases have pre-defined keys.

Database name -> Key field

The database name is the name of the secondary table to join to the Main table listed as the top of the dialog. The key field is the field reference within this database.

Joined By

This is the name of the field from the Main table that contains the key or matched information that the secondary table will join itself to. Click on the down arrow to display a list of all available Main table fields that you can choose from. You may also define a key expression here but this is usually not necessary.

It is often necessary to join additional tables to the Main table in order to be able to select and display the information you require on the form.

The key to successfully joining database tables together is to find what they have in common. In many cases CAPITAL will suggest what they have in common automatically for you. For example, the table INVOICE contains a field called ACCCODE which stores the customer account code. The table CUSTREC (customer details) contains a field called CUSCODE which also stores the customer account code. The correct Database + Key would be:

Custrec->Cuscode

This means: "the field Cuscode stored inside the database table Custrec."

The Joined By key would be:

Acccode

Note that you don't have to specify: Invoice->Acccode. CAPITAL will assume this automatically.

In the above examples you can also use "Customer" in place of "Custrec" and "Account" in place of "Cuscode" or "Acccode". CAPITAL treats these alternate names as meaning the same thing.

Note that you cannot join tables together if you cannot find what they have in common. (This is the "key" to finding what joins them together.) For example, you cannot join the stock database table to the salesperson database table because neither of these tables contain fields that store the same information.

You could, however, join a service manager job to an invoice. Close inspection of the fields contained in these database tables would reveal that the JOBCARD (or SMJOBS) database contains a field called JOB. The INVOICE database table also contains a field called JOB. Since these fields contain the same data (i.e., job numbers), the tables can be joined together.

In most cases you do not have to do anything special to locate the "key" that enables you to join tables. Simply click on the down arrow to select from the available list. If no suggestions are provided you can enter your own key field if you happen to know what it is. For more information on joining databases see: Linking Forms - Hints & Problem Solver.

generate/notepad.gifYou may also specify a character variable here if the Main table is a variable. Surround your variable with double quotes. E.g., "TableName"->Myfield

Export...

Select this option if you want the information generated by this body to be output to a data file.

____________________________

Related Topics

Linking Concepts

Exporting Data