Progressbar et base de données
bonjour
J'ai une application qui lit une table access pour initialiser des boutons (couleur, intitulé, visibilité, action, etc etc) il y en a environ 500 boutons
Au demarrage de l'application, j'initialise cette form au click sur un bouton.
Mais avant d'avoir le résultat (que la feuille s'affiche) tout est figé et c'est un peu long.
J'aimerais créer un progressbar qui montre l'évolution mais je n'ai aucune idée de comment faire. Savez vous ou trouver cela ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
For j = 1 To 7
StrQuery = " SELECT * FROM T_Ecrans Where Id_Ecran = " & j & ""
cn.Open StrConnex
rstableau.Open StrQuery, cn, adOpenDynamic, adLockOptimistic, adCmdText
If rstableau.RecordCount > 0 Then
rstableau.MoveFirst
Tableau(j).BackColor = rstableau.Fields(1).Value
Appel_Form(j).BackColor = rstableau.Fields(1).Value
For i = 1 To rstableau.RecordCount
vkCommand1(i + Tabl).Caption = rstableau.Fields(4).Value
vkCommand1(i + Tabl).BackColor1 = rstableau.Fields(7).Value
vkCommand1(i + Tabl).BackColor2 = rstableau.Fields(7).Value
vkCommand1(i + Tabl).ForeColor = rstableau.Fields(5).Value
vkCommand1(i + Tabl).Font.Size = rstableau.Fields(6).Value
vkCommand1(i + Tabl).Font.Name = "Courier"
......
.....
vkCommand1(i + Tabl).Refresh (True)
Label1(i + Tabl).Caption = rstableau.Fields(3).Value
Label1(i + Tabl).Visible = False
If rstableau.Fields(8).Value Then
vkCommand1(i + Tabl).Visible = True
Else
vkCommand1(i + Tabl).Visible = False
End If
rstableau.MoveNext
Next i
End If
Tabl = Tabl + 63
cn.Close
Next j |