473,466 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

another problem

How can u reset the autonumber field back to 1? answer pls.. thnx for your
help..

--
Message posted via http://www.accessmonster.com

Apr 30 '07 #1
3 1255
On Mon, 30 Apr 2007 10:24:18 GMT, "hugz via AccessMonster.com" <u33625@uwewrote:
>How can u reset the autonumber field back to 1? answer pls.. thnx for your
help..
Delete the table contents, then compact and repair the database. Access won't reset the internal counter until you C&R.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
Apr 30 '07 #2
Open your table in design view. Delete the autonumber field. Reenter the
autonumber field. The autonumber field will now start at 1 and increment by
1 for each record in the table.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdatasheet.com


"hugz via AccessMonster.com" <u33625@uwewrote in message
news:7178beb243220@uwe...
How can u reset the autonumber field back to 1? answer pls.. thnx for your
help..

--
Message posted via http://www.accessmonster.com

Apr 30 '07 #3
I created this procedure for resetting autonumbers.

I would like to mention however that autonumbers are not necessarily
always consecutive. If you start to add a record and cancel it then
the next record you attempt to add will have the next autonumber in
the sequence.
You need to add the Reference:
"Microsoft ADO Ext. 2.8 for DDL and Security"
' ************************************************** *****************
' resestSeed - resets an autonumber field
' ************************************************** *****************
' tableName - the table that contains the autonumber
' fieldName - the field that is the autonumber
' seedValue - where you want the new autonumber to start
' ************************************************** *****************
Public Sub resetSeed(tableName As String, fieldName As String,
seedValue As Integer)
Dim cat As New ADOX.Catalog
Set cat.ActiveConnection = CurrentProject.Connection
cat.Tables(tableName).Columns(fieldName).Propertie s("Seed") =
seedValue
End Sub
Cheers,
Jason Lepack
On Apr 30, 6:24 am, "hugz via AccessMonster.com" <u33625@uwewrote:
How can u reset the autonumber field back to 1? answer pls.. thnx for your
help..

--
Message posted viahttp://www.accessmonster.com

Apr 30 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
4
by: Mountain Bikn' Guy | last post by:
I am having serious problems with the following IDE bug: Could not write to output file 'x.dll' -- 'The process cannot access the file because it is being used by another process. ' and BUG:...
188
by: christopher diggins | last post by:
I have posted a C# critique at http://www.heron-language.com/c-sharp-critique.html. To summarize I bring up the following issues : - unsafe code - attributes - garbage collection -...
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
3
by: qwerty | last post by:
I´m new to ASP.Net. My workmate has some experience with it. He claimed that in ASP.Net working with frames is much simpler than it was ASP. I asked explanation but he couldn't give me such. (a...
17
by: Bruno | last post by:
I have a feature that is hosted on a different domain from the primary one in a frame, and need to retain values in a cookie. example: A web page at one.com contains a frame which has a page...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
5
by: felipevaldez | last post by:
how can I put an element below another element, that's not absolutely positioned? so I have a n element, called X, and next to that, an element Y X Y XXXXXX
3
by: drummond.ian | last post by:
Hello Everyone, This problem's been causing me a lot of trouble and I'm hoping somebody can help me out!! I have a dialog-based MFC application in visual studio 2003. I want to call a...
11
by: Jan | last post by:
Hi: Here's a problem I've had for a long time. The client is really running out of patience, and I have no answers. Access2003, front- and back-end. Single form with 4 subforms (each...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.