In my form (Datasheet), after delete some positions i need to recount my sequence e.g. if i have
1
2
3
4
after deleting position 2, query will change value bigger than 2 to achieve the correct sequence
from
1
3
4
to
1
2
3
so my query is
And it works well!! But only if i select only one row. When i select two or more rows then Ms Access shows error that stops these changes because someone tried to change data in the same time. Is there any possibilities to solve this problem?
1
2
3
4
after deleting position 2, query will change value bigger than 2 to achieve the correct sequence
from
1
3
4
to
1
2
3
so my query is
Code:
strSQL = "UPDATE tblProcesyZlecenia SET kolejnosc = kolejnosc - 1 WHERE kolejnosc in (select kolejnosc from tblProcesyZlecenia where id_kartatechnologiczna=" & Me.id_kartaTechnologiczna & " and kolejnosc>" & Me.kolejnosc & ")"
CurrentDb.Execute strSQL