Incrementing field by 1 automatically in Access db
Hi all, I am using testpartner to automate a test and send data back to an access db. The main function is working fine but I want to have an individual ID for each time i run the test. Preferably i want this to be done automatically each time i run the test.
I am not entirely sure how to do this, the current code i have is:
rs.Fields("ID") = (rs.Fields("ID") + 1)
This doesnt work and i am no coder! any help would be greatly appreciated, cheers.
ps. I am using TP 5.6
Re: Incrementing field by 1 automatically in Access db
Just incase anyone needs this for future reference:
After some fiddling about i managed to get it to work, i simply moved to the final record and then used a do.. while loop to update all the current records to be + 1.
This seems to work now, the code is as follows:
Do While rs.BOF = False
rs.Fields("ID") = rs.Fields("ID").Value + 1
rs.Fields("ID") = "1"
rs.Fields("Parameters") = "This test was run with " & ParameterText & " Garbage Collections"