Previous Topic

Next Topic

Inhoudsopgave

Book Index

Multiselect Edit Form Code Snippet

Dim Frm, btnTest

Sub Main

Set Frm = IsahObjects.Get("EditFormObject")

With Frm

.ProgramCode = 1500000001

.TableName = "T_COUNTRY"

.GridSQL = "SELECT * FROM T_Country"

.PrimaryKey = "CountryCode"

End With

Set btnMultiSelect = IsahObjects.Get("TButton")

With btnMultiSelect

.Parent = Frm

.Name = "btnTest"

.Left = 400

.Top = 5

.Width = 75

.Height = 25

.Caption = "MultiSelect"

.TabOrder = 0

.OnClick = "btnMultiSelectClick"

End With

Frm.ShowModal

Set btnMultiSelect = nothing

Set Frm = nothing

End Sub

Sub btnMultiSelectClick(Sender)

Dim BMString

MsgBox "Number of selected records: " & Frm.IsahGridMain.SelectedRows.Count

Frm.GridDataset.DisableControls

For i = 0 To (Frm.IsahGridMain.SelectedRows.Count -1)

Frm.GridDataset.BookMark = Frm.IsahGridMain.SelectedRows.Items(i)

MsgBox Frm.GridDataset.Fields(0).AsString

Next

Frm.GridDataset.EnableControls

End Sub