database corruption? (1 Viewer)

BennyLinton

Registered User.
Local time
Today, 05:41
Joined
Feb 21, 2014
Messages
263
I have a large database with admittedly some design flaws I inherited namely that the identifying customer number is an autonumber. The problem that has suddenly arisen is my numbers were incrementing properly at 16595, 16596, 16597, etc. and then suddenly I'm getting numbers like 105252012, 105252013, 105252014, etc. appended. I deleted those and still the seed appears to be stuck at such numbers. Is there a way like is done in SQL Server, in Access to reseed to 16598? :banghead:
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:41
Joined
May 7, 2009
Messages
19,242
CurrentProject.Connection.Execute "ALTER TABLE yourTable ALTER COLUMN ID COUNTER(16598, 1);"

Backup the table first.
 

BennyLinton

Registered User.
Local time
Today, 05:41
Joined
Feb 21, 2014
Messages
263
Do I place this code in a module and open it or a query?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:41
Joined
May 7, 2009
Messages
19,242
Make a second cipy of the table.

Go to vba and type it in immediate window.

Or make a oublic sub/ func and run it.
 

BennyLinton

Registered User.
Local time
Today, 05:41
Joined
Feb 21, 2014
Messages
263
I put this in the main form, but I'm not sure how to run it:

Public Sub Reseed()
CurrentProject.Connection.Execute "ALTER TABLE applicants ALTER COLUMN ID COUNTER(16514, 1);"
End Sub
 

BennyLinton

Registered User.
Local time
Today, 05:41
Joined
Feb 21, 2014
Messages
263
This is a split-database with the applicants table being a linked table in Access
 

BennyLinton

Registered User.
Local time
Today, 05:41
Joined
Feb 21, 2014
Messages
263
ok think this was correct... I went into the linked BE database's form, typed the line into the Immediates Window, hit enter and i think it worked
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:41
Joined
May 7, 2009
Messages
19,242
If it doesnt work, open the be and do it there.
 

Users who are viewing this thread

Top Bottom