[Solved] Reset Autofield

Creating and using forms
Post Reply
Wimba
Posts: 8
Joined: Tue Oct 21, 2008 8:08 pm

[Solved] Reset Autofield

Post by Wimba »

Created real simple database with one form. Used Autofield as key - did some testing, now I want to implement but Autofield is starting at 9 (tested 8 times). How do I start at 1 now that I am ready to implement?
Last edited by Hagar Delest on Mon Mar 09, 2009 12:40 am, edited 1 time in total.
Reason: tagged [Solved].
OOo 2.3.X on MS Windows Vista
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Reset Autofield

Post by TheGurkha »

Hi and welcome to the forums.

Well, you don't really need to. It'll start at 9 and do just as well as if it started at 1.

Or are you using the field as some sort of visible thing in the form as well?
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
QuazzieEvil
Volunteer
Posts: 283
Joined: Tue Dec 04, 2007 6:38 pm
Location: Houston, TX

Re: Reset Autofield

Post by QuazzieEvil »

you can restart it with the following SQL command

Code: Select all

ALTER TABLE <table name> ALTER COLUMN <column name> RESTART WITH <restart value>
enter that command in the SQL dialog (Tools | SQL.. )
Wimba
Posts: 8
Joined: Tue Oct 21, 2008 8:08 pm

Re: Reset Autofield

Post by Wimba »

Thank you both - I guess you have a point about what difference does it make - guess I'm just being anal - on the other hand good to have the code if I can't get over it!

Thanks again
OOo 2.3.X on MS Windows Vista
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Reset Autofield

Post by TheGurkha »

Ha ha - we're all anal about something.

If this has answered your question please go to your first post and use the edit button and add [Solved] to the start of your title. You can also select the green 'tick' icon.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
Post Reply