Public Sub fill_grille() On Error GoTo bug_fill: bt_search.Enabled = False bt_maj.Enabled = False Set tb = db.OpenRecordset("SELECT * FROM mots ORDER BY mots ASC") wb.Visible = True ' <------------------- init webbrowser wb.Navigate App.Path & "\attente4.gif" ' <----------- show GIF ' DoEvents inutile ici tb.MoveFirst With grille .Clear .Rows = 2 .Row = 0 nbre_mots = 0 ' boucle lecture Do Until tb.EOF .RowHeight(.Row) = 300 * tb("nombre") .Col = 0 .Text = tb("mots") .CellAlignment = FlexAlignmentLeftCenter .Col = 1 .Text = tb("auteur") .Text = Replace(.Text, "/", vbCrLf) .Col = 2 .Text = tb("page") .Text = Replace(.Text, "/", vbCrLf) .Col = 3 .Text = tb("nombre") .Rows = .Rows + 1 .Row = .Row + 1 nbre_mots = nbre_mots + 1 ' tb("nombre") tb.MoveNext DoeEvents ' ici il est utile le DoEvents Loop ' fin boucle zone_mots = nbre_mots bt_search.Enabled = True bt_maj.Enabled = True .Rows = .Rows - 2 Visible = True .MousePointer = vbArrow End With wb.Visible = False ' <------- masquer webbrowser Exit Sub bug_fill: MsgBox Error db.Close End End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionForm1.Frame1.Visible = True Form1.Frame1.Refresh Form1.pb.Visible = True Form1.pb.Refresh Form1.pb.Max = 1000 Form1.pb.Min = 0 Form1.pb.Value = 0 x = 0
If x < 1000 Then Form1.pb.Value = Form1.pb.Value + 1 x = x + 1 Else x = 1 Form1.pb.Max = 1000 Form1.pb.Min = 0 Form1.pb.Value = 0 End If
Form1.zone_mots = nbre_mots Form1.Frame1.Visible = False Form1.pb.Visible = False
With End With
Form1.Frame1.Visible = True Form1.Frame1.Refresh Form1.pb.Visible = True Form1.pb.Refresh Form1.pb.Max = 1000 Form1.pb.Min = 0 Form1.pb.Value = 0 x = 0
With Form1 With Frame1 .Visible = True .Refresh End with With pb .Visible = True .Refresh .Max = 1000 .Min = 0 .Value = 0 End With End With x = 0
x = 0c'est quoi x ? C'est une inconnue comme les maths ? Donne lui un nom de variable plus parlant en rapport avec son rôle . si dans 6 mois tu dois reprendre une partie du code tu t'y retrouveras bien mieux !