im facing a challenge here peple. i will give as much detail as i can.
i am trying to come up with code such that when a button is clicked it runs through a field "copiesremainng" in my subscription table and subtracts 1 from every record in that field. this has to be achieved by clicking only once.the code im using and is not doing anything nor giving me a syntax error, is as follows
With ri
.ActiveConnection = deSub.conn
.LockType = adLockOptimistic
.Source = "select * from cooperatesubs"
.Open
End With
Do Until ri.EOF = True
q = ri.Fields("copiesout")
r = ri.Fields("numberofcopies")
s = r - q 'reducing the number by the copies to be given out every time
ri.Fields("copiesremaining") = s 'updating the field with the new figure
ri.Update
ri.MoveNext
Loop
Exit Sub