1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Function AjouterPrenomListe1(NumId As String) As String
Dim rstT1 As DAO.Recordset
Dim PrenomResult As String
Set rstT1 = CurrentDb.OpenRecordset("T_Liste1", dbOpenSnapshot)
PrenomResult = " "
With rstT1
.FindFirst "[numéro_identité]='" & NumId & "'"
While Not .NoMatch
PrenomResult = PrenomResult & ![Prénom] & ","
.FindNext "[numéro_identité]='" & NumId & "'"
Wend
End With
Debug.Print PrenomResult
PrenomResult = IIf(PrenomResult = " " Or IsNull(PrenomResult), "", Left(PrenomResult, Len(PrenomResult) - 1))
AjouterPrenomListe1 = PrenomResult
rstT1.Close
Set rstT1 = Nothing
End Function |
Partager