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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| Option Compare Database
Option Explicit
Private Sub Form_Load()
Me.TimerInterval = 50
End Sub
Private Sub Form_Timer()
Dim i As Integer
Dim j As Integer
Dim str As String
Me.TimerInterval = 0
str = Nz(Forms!frm_Truc_Et_Astuce.OpenArgs)
If Len(str) > 0 Then
'---------------------------------------------------
' Attendre la fin de fermeture de la form pour
' pouvoir la réouvrir en mode Design
'---------------------------------------------------
While Ecran_Is_Open("Form1")
For i = 1 To 999
For j = 1 To 999
Next j
Next i
Wend
'---------------------------------------------------
' Sauvegarde de la nouvelle liste
'---------------------------------------------------
DoCmd.OpenForm "Form1", acDesign
Forms("Form1").Controls("zdl2").RowSource = str
DoCmd.Close acForm, "Form1", acSaveYes
End If
DoCmd.Close
End Sub
Function Ecran_Is_Open(Ecran As String) As Boolean
Dim frm As Form
For Each frm In Forms
If frm.Name = Ecran Then
Ecran_Is_Open = True
Exit Function
End If
Next frm
Ecran_Is_Open = False
End Function |
Partager