Previous Topic

Next Topic

Inhoudsopgave

Book Index

LinkedInfoFormObject Code Snippet

'This code snippet shows an example of a linked InfoFormObject

'This example shows all customer addresses.

'Link this script to the Customers form (F0001).

'When customer address data is updated in the the data in the info form will

'automatically be update as well.

'The Link is realised by passing a parameter in the where clause of the sql statement

'and the ScrollWithParent property.

Sub Main

Set Frm = IsahObjects.Get("InfoFormObject")

Frm.SQL = "Select CustId, Name, Addr, PostCode, City, Phone " & _

"From T_CustomerAddress Where CustId = :CustId And CustAddrCode <> ''"

Frm.KeyField = "CustId"

Frm.SetContextCodeKeyField 1, "CustId"

Frm.SetContextCodeKeyField 2, "Name"

Frm.ScrollWithParent = True

Frm.ShowModal

Set Frm = Nothing

End Sub