Previous Topic

Next Topic

Inhoudsopgave

Book Index

Drop-Down List Boxes

Description

Some Isah tables contain fields that do not contain the value as displayed on screen, but which contain a code that refers to the value. Carry out the following actions to retrieve the name of such a drop-down list box:

  1. Open the application.
  2. Open the module, then the screen and finally the tab that contains the drop-down list box concerned. For example, open the Personnel module, Employees screen and General tab.
  3. Hold SHIFT while you click the What's this help icon (Wat is dit?).
  4. Now click the field you wish to retrieve technical data from. For example, the Gender field.
  5. The Field info screen will be displayed.
  6. In the Field name row, you can find the list box name of the actual field. If a field contains a drop-down list box, you can find the name of the list box in this manner.

Properties, Procedures and Functions

Function Function GetTypeString( Name: String): String

Function Function GetTypeStringValue( Name: String, Type: String): Integer

Function Function GetTypeValueString( Name: String, Item: Integer): String

Example

Sub Main()

' Displays all order codes

MsgBox Application.GetTypeString("OrdCode")

MsgBox Application.GetTypeStringValue ("OrdCode","Purchasing")

MsgBox Application.GetTypeValueString ("OrdCode",3)

End Sub

Example

Combination with a combo box

Sub Main()

if ShowEditForm = 1 then

MsgBox "You have confirmed the entry"

End If

End Sub

Function ShowEditForm()

Dim frm, X, Y

Dim CmbBox

' Creates an empty form

Set frm = application.IsahForms.CreateEditForm

frm.EditOffSet = 125

frm.Caption = "Basic data entry form"

Set CmbBox = frm.AddComboBox ("CB1",,,,"Combo box example","",0,false)

' Fills a combo box with info from DmTypes

CmbBox.Items = Application.GetTypeString("OrdCode")

' 4 is the DB value or fixed value of example

CmbBox.Text= application.GetTypeValueString("OrdCode",4)

frm.SetBounds 0,0,266,153

frm.Center

ShowEditForm = frm.ShowModal

' Determines the value of the selected line

MsgBox Application.GetTypeStringValue("OrdCode" , CmbBox.Text)

End Function

Example

Combination with a combo box

Sub Main()

if ShowEditForm = 1 then

MsgBox "You have confirmed the entry"

End If

End Sub

Function ShowEditForm()

Dim frm, X, Y

Dim CmbBox

' Creates an empty form

Set frm = application.IsahForms.CreateEditForm

frm.EditOffSet = 125

frm.Caption = "Basic data entry form"

Set CmbBox = frm.AddComboBox ("CB1",,,,"Combo box example","",0,false)

CmbBox.Items = Application.GetTypeString("OrdCode")

CmbBox.ItemIndex = Application.GetTypeStringValue("OrdCode","Phantom")

frm.SetBounds 0,0,266,153

frm.Center

ShowEditForm = frm.ShowModal

End Function