Dim oApp As Object
Dim rst As DAO.Recordset
Dim table As DAO.Database
Dim i As Integer
Dim nom_de_base As String
Set table = CurrentDb
Set rst = table.OpenRecordset("Test")
nom_repertoire = CurrentProject.Path + "\"
nom_de_base = rst.Fields("nom").Value
i = 0
While Not rst.EOF
rst.Edit
rst.Fields("photo_1").Value = "photos150#" & LCase("photos150\" & Replace(nom_de_base, " ", "_") & "_ensemble.jpg"
rst.Update
i = i + 1
rst.MoveNext
Wend
rst.Close
table.Close
Set rst = Nothing
Set table = Nothing
Debug.Print "nombre d'enregistrement =", i
End Sub
Catégorie : VBA Access Rubrique: divers
Ang: update
Fra.: actualiser
Private Sub maj_photo_table_click()
Dim oApp As Object
Dim rst As DAO.Recordset
Dim table As DAO.Database
Dim i As Integer
Dim nom_de_base As String
Set table = CurrentDb
Set rst = table.OpenRecordset("Test")
nom_repertoire = CurrentProject.Path + "\"
nom_de_base = rst.Fields("nom").Value
i = 0
While Not rst.EOF
rst.Edit
rst.Fields("photo_1").Value = "photos150#" & LCase("photos150\" & Replace(nom_de_base, " ", "_") & "_ensemble.jpg"
rst.Update
i = i + 1
rst.MoveNext
Wend
rst.Close
table.Close
Set rst = Nothing
Set table = Nothing
Debug.Print "nombre d'enregistrement =", i
End Sub