Previous Topic

Next Topic

Inhoudsopgave

Book Index

Lookup Forms

Description

You can use most of the lookup forms as selection forms. In that case, the user is able to select a line and subsequently, he can choose between an Ok and a Cancel button. The LookupFields property determines which fields of the selected line will be returned as a result. If the user closes the form by clicking the Ok button, the fields in the LookupFields property contain the values of the selected line.

If you do not define any field in the LookupFields property the lookup form will contain a Close button instead of an Ok and a Cancel button and in addition, will be opened Modal. The user has to close the form before he can use other Isah functions.

The following code opens a lookup form:

Dim oDataForm as IERPLink.IISERPDataForm

Dim oField As IERPLink.IISERPField

Set oDataForm = oERPLink.CreateDataForm("0071")

oDataForm.Lookup = 1

oDataForm.DataParams.Add ("PARTCODE", 1, “Auto”)

Set oField = oDataForm.LocateFields.Add("BOMLINENR", 3)

oField.Value = 4

oDataForm.LookupFields.Add ("SUBPARTCODE", 1)

oDataForm.LookupFields.Add ("LINENR", 3)

oDataForm.LookupFields.Add ("DESCRIPTION", 1)

If oDataForm.Show() = 1 Then

MsgBox "The selected line is: " & _

oDataForm.LookupFields.Item(1).Value

End If