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 33 34 35 36 37 38 39 40 41 42
| '--- Intérogation de la tbl adhérents rs
rq = "select * From [tbl Adhérents]"
Set rs = db.OpenRecordset(rq, dbOpenDynaset)
'--- Intérogation de la tbl licences rs1
rq = "SELECT * " & _
"FROM [tbl Licences] " & _
"WHERE ((([tbl Licences].Code_Club)=1111));"
Set rs1 = db.OpenRecordset(rq, dbOpenDynaset)
If rs.EOF Then blnCibleVide = True Else blnCibleVide = False
'--- Boucle sur la table rs1
Do While Not rs1.EOF
'--- Rechercher si le numéro de licence existe
If blnCibleVide Then
blnExistePas = True
Else
rs.FindFirst "[NomAdhérent]=" & Chr(34) & rs1("NomAd") & Chr(34) & " and " & _
"[Prénom]=" & Chr(34) & rs1("Prénom") & Chr(34)
blnExistePas = rs.NoMatch
End If
'--- Pas de numéro de licence trouvé,
If blnExistePas Then
rs.AddNew
rs("NuméroLicence") = rs1("No_Licence")
blnCibleVide = False
Else
'--- Existe on met à jours
rs.Edit
End If
'--- Ajout/Mise à jour des autres champs
rs("NuméroLicence") = rs1("No_Licence")
,,,,,,
,,,,,,,
rs.Update
rs1.MoveNext
Loop |