Try DSum("number","table1","[name]= 'a' AND " & "[id]<=" & [id])
Keep in mind this will only work for the case where [name]=a. You can use the field value in the query.
DSum("number","table1","[name]= '" & [name] & "' AND " & "[id]<=" & [id])
A word of caution, it's not a good idea to use...