I have a table where in first column "id" has serial nos. not in order. Now I want to update the column in the table with a query from (serial no. 1 and it should increment by 1 upto last row. How I can write query?
I have a table where in first column "id" has serial nos. not in order. Now I want to update the column in the table with a query from (serial no. 1 and it should increment by 1 upto last row. How I can write query?
Order in table should not matter. Why do you want to do this? I don't think an UPDATE query can do this. Would need VBA code.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes it is not important but it helps to see total number of records in a table at ease. I don't know how to use and run vba code at all.
You want to see number of total records when table is open? The record navigator at bottom of table shows that.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
yes I know that. But still I just wanted to know if I can change and correct the SR. no.. Now it's not in proper order, the last row Sr. no. is 3556 but at record navigator it shows (2780). That shows there are some nos. are missing.
The Serial number is an autonumber datatype? Is this the primary key used as foreign key in other tables. If so, DO NOT try to change. If it is not the primary key field, you can delete the autonumber field and then create a new one.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes it is not used as foreign key in any other table. I can delete the column, but how I can add it again with increment in access?
This is an Access table, not a SQL or some other link table? Autonumber field will increment by 1.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.