Code :
Sub SelectX1() Dim dbs As Database, rst As Recordset Dim somme as integer Set dbs = OpenDatabase("tabaseaccess.mdb" ) Set rst = dbs.OpenRecordset("SELECT mina, minb,minc,mind,mine from analyse;" ) rst.Movefirst somme = rst("mina" ) + rst("minb" ) + rst("minc" ) + rst("mind" ) + rst("mine" ) dbs.execute("update table analyse set totalmin = " & somme & " ;" ) dbs.Close End Sub
|