473,699 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reset AutoNumber

28 New Member
I am trying to set my autonumber field to reset automatically at the beginning of each new year. This is a three digit field and is used with the date for a report number field. The number is currently set to auto fill and looks like this
00/00/0000-000. I want the last three digits to reset with the new year date field. Both fields are hidden and combine in the report number text box.
May 24 '07 #1
2 2836
JConsulting
603 Recognized Expert Contributor
I am trying to set my autonumber field to reset automatically at the beginning of each new year. This is a three digit field and is used with the date for a report number field. The number is currently set to auto fill and looks like this
00/00/0000-000. I want the last three digits to reset with the new year date field. Both fields are hidden and combine in the report number text box.
You're opening a can of worms with this one...but it's not hopeless....

I think the easiest way to get this one is to create a new table for your new year. Let it's autonumber start with 1.

then write a union query to join the yearly tables for any form or report purposes.

You really shouldn't reset autonumbers...u nless it doesn't affect any foreign keys..then they are just numbers. but you can't resequence 1 without resequencing the rest.

J
May 24 '07 #2
NeoPa
32,569 Recognized Expert Moderator MVP
I think you're better off leaving AutoNumbers out of this completely. There are a couple of threads in here that discuss better ways of doing this, related to the data already extant in the table.
May 25 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
23767
by: deko | last post by:
Is there a way to reset the AutoNumber sequence? I have several tables that use the AutoNumber field as the Primary Key, and I'd like to somehow do an Import/Export that will make remove the breaks in the sequence. A few breaks in sequence is not a big deal, but I have one table with under 200 records, but the last AutoNumber PK ID field is over 1500 - due to a lot of edits....
3
8670
by: Cillies | last post by:
Hello, I was wondering if anyone knew how to reset an auto number. I.E. in my database I have two tables with autonumbers as primary keys. So I was wondering if anyone knew an easy way of resetting them, as I have made a few errors throughout the database. Kindest Regards
2
5616
by: N. Graves | last post by:
Hey is there a command like in SQL Transactional that will reset the Autonumber field to the highest number in the found in the field? I developing a access database with a several table that have autonumbering. I would like to reset them back to 0 after I delete all the rows of data. Is there an easier way to do this other than creating a new field and remove the old autonumber? Maybe in the system table?
16
20505
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number can go without the system crashing. An ancillary question is how one resets an auto number so that the sequence starts again at 1. In the case of this file, the auto number field serves no useful purpose except as an
4
8787
by: Danny | last post by:
I have a db that has a table that is never deleted but just has records cleaned out "delete * from table" but each time it is populated, the autonumber is not reset to 0 and picks up where it left off even though I delete the records. Is there a way in code i can compact the database (I know this is the way to reset that blank tables autonumber to 0). I know I can compacdt on exit but
2
2609
by: Richard Hollenbeck | last post by:
I use a temporary table to assemble unrelated data for specific forms and reports. After each use of this table, I have a delete query which empties the table out for its next use. I have one field I want to populate with the record number as it appears in the form. That way I can use a comparison with Me.CurrentRecord to change the background color of the text boxes for the OnCurrent property. I'm doing this because I want the record...
3
11234
by: trueblue7 | last post by:
I apologize if this question has been asked before... I'm trying to reset autonumber fields back to 1. The autonumber fields are part of the composite primary keys. I followed the MS help with a temp table and append query. I can change the number to anything but 1. I'm using Access XP and saving as 2000. Any help is appreciated.
2
2749
by: junkaccount | last post by:
Hello, I currently have a field named QuoteNumber in a table named Quotes. The field is set as autonumber and is used to assign sequential numbers as users enter information in the table through a form. This number is mainly used later as reference when a customer calls our office with questions. We use the quote number to retrieve their related information through a query. This QuoteNumber field is NOT a primary key. It is not...
2
8252
by: jillian.calderon | last post by:
Good Morning Everyone, I'm making a database and I'm playing with it using test data. When I want to put the actual data in, how do I reset the autonumber back to 1? How do I tell the database to completely delete the fake records so the autonumber doesn't start at, o, 50? Thanks! Jillian
2
2819
mkremkow
by: mkremkow | last post by:
Access 2003 on XP Someone here at work deleted a record (&$%^&*&!!!) and screwed up the Autonumber "Job ID" field . I need to reset the Autonumber field back to it's original numbers and still keep all the data in the table assigned to the correct Job ID (1-155). I copied everything from the table to Excel for safekeeping. I deleted the Autonumber field and went through the steps (http://support.microsoft.com/kb/812718 ) but when I...
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8617
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8914
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8884
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4376
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.