Listview ItemClick problem

sigster

Active Member
Licensed User
Longtime User
Hi can anyone help me with this Please

when I click on Listview I get error Object should first be initialized (Label)
Lab_simi.Text = Cursor.GetString("simi")

B4X:
Sub read_to_listview
 Dim Cursor As Cursor
   
   ProgressDialogShow("Lés gagnaskrá")
     Listview_sundstadir.Clear   

    Cursor = SQL.ExecQuery("select * from sundstadir_info")

     For i = 0 To Cursor.RowCount - 1
    Dim tt As personangsmnn
         Cursor.Position = i
     tt.nafn=Cursor.GetString("nafn")
     tt.opidfra=Cursor.GetString("heimilisfang")
     Listview_sundstadir.AddTwoLines2 (tt.nafn,tt.opidfra,tt)
    Next
    Cursor.Close
    ProgressDialogHide
   
End Sub


Sub Listview_sundstadir_ItemClick (Position As Int, Value As Object)   


   Panmain.Visible=False
   Pansundstadir.Visible=True
   
       Dim Cursor As Cursor
   
      Dim tt As personangsmnn
      tt = Value
      
    
 Cursor = SQL.ExecQuery("select * from sundstadir_info where nafn like '" & tt.nafn & "%' order by nafn;")
 Cursor.Position = 0

   
   labopid.Text = Cursor.GetString("sumar_opid")
   Lab_heima.Text = Cursor.GetString("heimilisfang")
   Lab_simi.Text = Cursor.GetString("simi")        <----------- ERROR

    Cursor.Close
    ProgressDialogHide
   
   
     
End Sub
 

sigster

Active Member
Licensed User
Longtime User
Thanks Erle !!

this was too obvious !

In Designer when I select the form I need to scroll up to see Label name
so I did not see this

Regards
Sigster
 
Upvote 0
Top