|
|
|
|
Salut
|
Ok merci !
|
Voila un pti truc tu met l'inteval du timer a 0 et lorsque tu veux tu declancher le chrono tu affecte a interval une autre valeur par exemple 1000 = 1 seconde et dans
|
Bonjour,
|
Bonjour,
Private Declare Function GetTickCount Lib "kernel32" () As Long
Public Sub xWait(ByVal MilsecToWait As Long)
Dim lngEndingTime As Long
lngEndingTime = GetTickCount() + (MilsecToWait)
Do While GetTickCount() < lngEndingTime
DoEvents
Loop
End Sub
Dans le Form_Load du formulaire, tu initialises ton flag à false (ex: flagTimer = False). Ensuite, sur l'évènement Click de ton bouton du colles ça: Private Sub Command1_Click()
If flagTimer = False Then
flagTimer = True
ElseIf flagTimer = True Then
flagTimer = False
End If
Call Timer1_Timer
End Sub
Il ne reste plus qu'à coder la procédure du Timer en utilisant une boucle while : Private Sub Timer1_Timer()
While flagTimer = True
'1 - code pour la requête SQL
'2 - code pour le fichier
Call xWait(3000)
Wend
End Sub
Bon courage ;o) polux |