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
| Option Compare Database
Sub CreerTblDoublons()
Dim db As Database, r As DAO.Recordset, strSQL As String
Dim rDoublons As DAO.Recordset
Dim strCKey As String, strPKey As String
Dim strTable As String, strTblDoublons As String
strTable = "TableCombinaison7a"
strTblDoublons = strTable & "_Doublons"
DoCmd.SetWarnings False
DoCmd.RunSQL "SELECT first(combi) as combino, count(combi) INTO [" & strTblDoublons & "] FROM [" & strTable & "] group by combi HAVING (((Count(TableCombinaison7a.Combi))>1))"
DoCmd.SetWarnings True
Set db = CurrentDb
Set rDoublons = db.OpenRecordset(strTblDoublons)
rDoublons.Close
db.Close
End Sub |
Partager