1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Function modif(nomtable As String, prem As Integer, der As Integer,i as variant) As Boolean
'attention la collection fields a pour base zéro
Dim mabase As DAO.Database
Dim champ As String
Dim boucle As Integer
On Error GoTo fin
Set mabase = CurrentDb()
DoCmd.SetWarnings (False)
For boucle = prem To der
champ = mabase.TableDefs(nomtable).Fields(boucle - 1).Name
DoCmd.RunSQL ("UPDATE matable SET " & champ & " = [" & champ & "]*" & i & ";")
Next boucle
DoCmd.SetWarnings (False)
modif = True
fin:
MsgBox ("cata")
modif = False
End Function |
Partager