le message à toujours le même code d'erreur : 3075
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
| Private Sub RefreshQuery()
Dim SQL As String
Dim SQLWhere As String
SQL = "SELECT num_pers, nom_pers, pre_pers, lib_poste_pers, mail _pers, port_pers from personnel"
If Me.chkNom Then
SQL = SQL & "WHERE personnel!num_pers < > 0 And personnel!nom_pers like '*" & Me.txtRechNom & "*' "
End If
If Me.chkPre Then
SQL = SQL & "WHERE personnel!num_pers < > 0 And personnel!pre_pers like '*" & Me.txtRechPre & "*' "
End If
If Me.chkDir Then
SQL = SQL & " INNER JOIN direction ON (Direction!num_dir = Personnel!num_poste_pers) WHERE personnel!num_pers < > 0 And direction!lib_serv = '" & Me.ldRechDirection & "*' "
End If
If Me.chkServ Then
SQL = SQL & " INNER JOIN Service ON (Service.num_serv = Personnel.num_poste_pers) WHERE personnel!num_pers < > 0 And service!lib_serv = '" & Me.ldRechService & "*' "
End If
SQLWhere = Trim(Right(SQL, Len(SQL) - InStr(SQL, "Where ") - Len("Where ") + 1))
SQL = SQL & ";"
Me.lblStat.Caption = DCount("personnel!num_pers", "personnel", SQLWhere) & " / " & DCount("personnel!num_pers", "personnel")
Me.lstResultat.RowSource = SQL
Me.lstResultat.Requery
End Sub |
l'erreur se trouve sur la ligne :
Me.lblStat.Caption = DCount("personnel!num_pers", "personnel", SQLWhere) & " / " & DCount("personnel!num_pers", "personnel")
Bizarre parce que j'ai presque rien changer dans cette ligne de code par rapport au tuto de Cafeine !
Partager