473,387 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Create autonumber

May anyone can teach me to assign a autonumber, I want to create a
number that is starting with year (auto change to year 2006) +
autonumber (eg. 2005-1001, 2005-1002 and so on)
Nov 13 '05 #1
2 2830
Rog
It is not a good idea to use an autonumber for anything else than a
record key behind the scenes, invisible to the user. If you want
numbers like the ones you describe you should use a counter and add 1
for every new record.

Nov 13 '05 #2

Apple wrote:
May anyone can teach me to assign a autonumber, I want to create a
number that is starting with year (auto change to year 2006) +
autonumber (eg. 2005-1001, 2005-1002 and so on)


Apple,

As Rog so eloquently said, to not use the Access autonumber system.
While I have never had any problems with it, I continue to read from
well informed developers to not use it. Better to use a unique table
to store your record numbers in. If you wish to creat a number with
the year, you can steal the clock date and place it into a memory
variable. Then read the top number from your unique number table.
Place that value into another variable. The third variable will
combine the values from the first two in the format you wish. I built
one in 1999 that reads the clock date, format out the last two digits
of the year, read the top number of the record table, marry the two
values and display it in text box that is not allowed to be modified by
the user. This way the number values continue correctly. Then the
form into which they input the record into the datebase is modal and
the only way out is to click on the OK or the Cancel button. If the
Cancel button is used, the number is not stored anywhere. The number
is stored only when the OK button is clicked and certain fields are
dirty. You can do what you want here. I hope this is some help for
you to get started either producing or ask more questions.

FlSteve

Nov 13 '05 #3

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

Similar topics

1
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
3
by: Gekko . via AccessMonster.com | last post by:
I want to create a query that the first field should be an autonumber. For example I want the name and last name from the Emp table, but I want that the first field is an autonumber that identifies...
24
by: flkeyman | last post by:
Work in legal office. Trying to create solid designed database structure. This is list of tables w/fields and primary keys. Any comments/advice greatly appreciated. tbl-Defendants CaseNumber...
5
by: Apple | last post by:
May anyone can teach me how to assign a autonumber, I want to create a number that is starting with year(auto change to year 2006) + autonumber (eg. 2005-0001, 2005-0002)
2
by: Apple | last post by:
Is there anyone can help me to solve this problem? Thank!
4
by: Apple | last post by:
1. I want to create an autonumber, my requirement is : 2005/0001 (Year/autonumber), which year & autonumber no. both can auto run. 2. I had create a query by making relation to a table & query,...
9
by: minjie | last post by:
I need to upgrade a MS Access database (Version 2002) with a script only, i.e., via SQL statement, not via Access GUI, and I'm having trouble defining an AutoNumber field. I got an exception error...
1
by: junis | last post by:
Dear Experts.. i need create table with identiry field .. if i use GUI ..i just click and choose autonumber as type ... but i try with SQL Stement : "Create Table Test (id autonumber, Desc...
1
by: sanju4kk | last post by:
I am attempting to create a module that I can call to create a new field in my temp table that will be an autonumber, and then assigned that new field as the primary key. I have been search high and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
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...

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.