Sub Activity_Create(FirstTime As Boolean)
' count the total records and those with a valid date (they are done).
nAnzGesamtLG = Main.sql1.ExecQuerySingleResult("select count(*) from LG")
nAnzAbgelesenLG = Main.sql1.ExecQuerySingleResult("select count(*) from LG where AbleseDatLG > '' ")
Activity.LoadLayout("...")
' LoadListTable1 ' Resume is enough
if nAnzGesamtLG = 0 Then
Msgbox("No Data","Info")
End If
End Sub
Sub Activity_Resume
If Main.SQL1.IsInitialized = False Then
Main.SQL1.Initialize(File.DirInternal, "data.db", True)
End If
LoadListTable1
End Sub
Sub LoadListTable1()
Dim cur As Cursor
Dim sLabel As String
lvTable1.Clear ' clear old lines
...
DoEvents
cur = Main.sql1.ExecQuery( "SELECT ... FROM Table1 WHERE ... ORDER BY ..." )
For i = 0 To cur.RowCount - 1
cur.Position = i
sLabel1 = i & " " & cur.GetString("ID" ) & ... fields ...
lvTable1.AddSingleLine( sLabel1, cur.GetString("ID" ) ) ' the ID of this line - 2. Parameter will be returnd after a click-event.
next
cur.Close
DoEvents
End Sub
Sub lvTable1_ItemClick (Position As Int, Value As Object)
... my program will now oben the edit page for Table1,
... you have to clear and load your second list !
LoadTable2(Value) ' the Value has now the ID from the active line in Table1
End Sub