Bonsoir,
Question simple et stupide, pourquoi ma requête ne fonctionne pas ? (il ne semble pas trouver mon champ "Total" !)
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 Dim SQL1 As String Dim Rs As Recordset Dim res As Integer SQL1 = "SELECT COUNT(N°Phrase) as Total FROM [Ma table] WHERE N°Phrase = " & Me.N°Phrase & "" MsgBox ("SQL " & SQL1) Set Rs = CurrentDb.OpenRecordset(SQL1) res = Rs.Fields(Total) MsgBox ("Nombre d'occ pour cette phrase : " & res)
Partager