Updating a subform from a parent form
Subforms only reload data when they know they need to. Unfortunately they are not very smart. This recipe will show you how to force a subform to refresh itself.
How to do it...
Create a new form from Object Designer.
Add the following global variables:
Name
Type
A
Integer
B
Integer
Add a global function named
SetValues
.Add the following parameters to the function:
Name
Type
Aparam
Integer
Bparam
Integer
Add the following code to the function:
A := Aparam; B := Bparam;
Add a global function called
UpdateSelf.
Add the following code to the function:
CurrForm.UPDATE;
Set the following properties on the form:
Property
Value
Width
5720
Height
1430
Your form should look like the following screenshot:
Save and close the form (for later use, remember the ID it is saved under).
Create a new form using the Object Designer.
Add the following global variables:
Name
Type
A
Integer
B
Integer
Add two textboxes with labels for each variable.
In...