Designing a form based on a temporary table
You may not always have the luxury of being able to save all of the information you need to the database. At other times you may want to calculate data on the fly and present it to the user in a form. Temporary tables come into play here and there is a special way to show their data on a form.
How to do it...
Follow the steps from the Using the Form Generation Wizard recipe in this chapter.
View the form properties by pressing Shift + F4.
Set the following properties on the form:
Property
Value
SourceTableTemporary
Yes
Add a global function named
LoadData
.Add the following local parameters to the function:
Name
Type
Length
NoParam
Code
20
NameParam
Text
50
Add the following code to the function:
"No." := NoParam; Name := NameParam; INSERT;
Add the following code to the
OnOpenForm
trigger:AddCustomer('1', FIELDCAPTION(Name) + '1'); AddCustomer('2', FIELDCAPTION(Name) + '2'); AddCustomer('3', FIELDCAPTION(Name) + '3');
Save and close the...