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 - A Tutorial generate/tab2d11.gif


As explained in the concepts section, it is usually necessary to link database tables together so that the information you want can be presented on a single form or report. If you use the Form Wizard or Report Wizard, Visual Builder will link all the necessary database files together for you. In these cases you do not have to worry about how linking "works".

Occasionally, however, you may need to build reports or forms not supported by the Visual Builder Wizards. In these cases you will also have to define your own links. Incorrectly defining links will probably mean that your form or report will not work the way you want it to.

Two issues must be settled before you can create successful links:

  • Which database file will you be stepping through?

  • What information do the database files share in common?

1. Specifying the Main Table

Forms and reports are essentially lists (columns of data). Which table most accurately represents that list? If we are going to create a report that shows customer account balances, then this report will list each account code, account name, other details, plus the account balance. Clearly, the main table will be the customer records file, as all that information is held in that file.

An invoice transaction is made up of at least three files:

  • The customer database file.

  • The invoice transaction file.

  • The invoice stock/services transaction file.

Which file should be the main file? That depends on the type of report we intend to create.

If we want to produce a transaction list that contains the customer account code, transaction number, order number and invoice total, then this information is held in the invoice transaction file. It should therefore be made the main database file.

If, however, we really wanted to show all sales of product "ABC" between two dates, then we will need to step through the invoice stock/services transaction file. (Because product information is not held in the customer transaction file or the customer records file.)

The main table is therefore the table that contains the central information that the report will focus on.

2. Linking Shared Information

Once the main table has been established, the next step is to determine what additional, secondary, information is required that the main table does not contain. If we have decided that the report will focus on invoice stock sales, and we inspect this database file, we will find that it does not contain any information relating to, say, the customer order number. This information is held in the customer transaction file. If we wanted to include this information on the report as well, then both tables would have to be joined (linked) together.

Before table linking is possible we must determine whether the tables share anything in common. It is not possible to link files together if they do not store at least some information that is common to both. In the case of the invoice transaction file and invoice stock/services transaction file, both store the same invoice/transaction number. This then becomes the basis for the link.