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
| Private Sub Command34_Click()
'Annule le message de validation
DoCmd.SetWarnings False
Dim VarLr As Integer
Dim bo As Boolean
bo = False
For VarLr = 0 To Me.lstResults.ListCount - 1
If Me.lstResults.Selected(VarLr) Then
DoCmd.RunSQL "INSERT INTO T_BeforePrint (ID, [Company], [Industry], [Account], " & _
"[City], [Country], Website, [E-Mail], [Phone], [Account Manager], " & _
"[Gender], [First Name], [Last Name], [Direct Number], [Title]) " & _
"SELECT Customers.ID, Customers.[Company Name], Customers.[Industry Type], " & _
"Customers.[Acount Type], Customers.[City], Customers.[Country], " & _
"Customers.Website, Customers.[E-Mail], Customers.[Phone 1], Customers.[Account Manager], Contact.[Contact Gender], Contact.[Contact First Name], Contact.[Contact Last Name], Contact.[Contact Title] " & _
"FROM Customers " & _
"INNER JOIN Contact ON Customers.ID = Contact.[Contact's Company] " & _
"WHERE (((Customers.[ID]) = " & Me.lstResults.ItemData(VarLr) & "));"
bo = True
'on incrémente le compteur
End If
Next VarLr
If bo Then
DoCmd.OpenForm "BeforePrint", acNormal
'Rafrechir le tableau
DoCmd.Requery "List4"
End If
End Sub |
Partager