[Gambas-user] make Label background from Database field

Vassilis K vkan53 at ...2300...
Sat Oct 17 18:29:09 CEST 2009


I get error:
"Result is not available"
at line:
"change_bgcolor("Label" & rsThesi!thesi)"

of the code:

PUBLIC SUB Form_Open()
  DIM i AS Integer
  DIM rsThesi AS Result
    MODMain.Connect()
    rsThesi = MODMain.$Con.exec("select * from egrafes where elenchosAnax = 
0")
    rsThesi.MoveFirst
    WHILE rsThesi.Index < rsThesi.Count
      change_bgcolor("Label" & rsThesi!thesi)
      rsThesi.MoveNext
    WEND 
    MODMain.$Con.Commit()
END

SUB change_bgcolor(labelname AS String)
  DIM alabel AS Object '
  FOR EACH alabel IN Form1.Children
    IF alabel.name = labelname THEN
      alabel.background = color.red
    END IF
  NEXT
END




More information about the User mailing list