473,386 Members | 1,775 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,386 software developers and data experts.

autonumber question ?

hi all!
i want to create group text for showing my invoice number.
the invoice no. is created by 3 parts.
1st part: autonumber increasing at each new record.
2nd part: 2 characters of current month.
3rd part: 1 character of current year.
Ex: 001-016 --invoice 001 of Jan 2006.
i created 3 unbound control to make 3 parts.
and 1 bound control(inv no.) will be get value from 3 unbound control.
i don't know how can i execute in defaul value of 3 unbound control.
i used: right(year(date()),1) in 3rd unbound control --ok, it works
fine.
but in 2nd one, i used: month(date()) and format property: @@ . it dont
work. ex: Feb --2 but i want it is 02.
And the autonumber --Pls help.

Any ideas or others to get the best result ?
Thanks with appreciated.
Luan from VietNam
Nov 9 '06 #1
8 2523
Try this:

InvoiceNum = [AutoID] & "-" & right("0" & month(date()), 2) & right(year(date
()),1)

luanhoxung wrote:
>hi all!
i want to create group text for showing my invoice number.
the invoice no. is created by 3 parts.
1st part: autonumber increasing at each new record.
2nd part: 2 characters of current month.
3rd part: 1 character of current year.
Ex: 001-016 --invoice 001 of Jan 2006.
i created 3 unbound control to make 3 parts.
and 1 bound control(inv no.) will be get value from 3 unbound control.
i don't know how can i execute in defaul value of 3 unbound control.
i used: right(year(date()),1) in 3rd unbound control --ok, it works
fine.
but in 2nd one, i used: month(date()) and format property: @@ . it dont
work. ex: Feb --2 but i want it is 02.
And the autonumber --Pls help.

Any ideas or others to get the best result ?
Thanks with appreciated.
Luan from VietNam
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1

Nov 9 '06 #2
and also:
InvoiceNum = [AutoID] & "-" & format(month(date()),"00") &
right(year(date
()),1)

So how will you tell the difference between an invoice number in the
year 2006 and year 2016.

remember you will not be able to easily use the invoice number to
separate records by year and month expecially after 10 years of
operation.

Ron.

Nov 9 '06 #3
great !
Thanks both of u.
perfective thinking.
i will revise it.
Luan from VietNam

Nov 10 '06 #4
If you are thinking of using part of the invoice number as a means of
grouping invoices, you should probably put the year IN FRONT of the
month.

For invoices I have created for our farm I have the invoice number as
follows

yyyymmdd-sssss

for your example it would be

yyyymmdd-[autonumber]

This lets you sequence them easily even when using the invoice number.

Also you avoid the problem of the months for multiple years showing up
together instead of seeing all the months for a single year and then
the next group of months for the next year.

Ron

Nov 10 '06 #5
thanks.
but how can i create a autonumber?
[autoid]or[autonumber] is not effective.
Pls teach how to do this ?
i couldnot find any post abt this.
thanks

Nov 11 '06 #6

"luanhoxung" <lu********@yahoo.comwrote
but how can i create a autonumber?
[autoid]or[autonumber] is not effective.
Pls teach how to do this ?
i couldnot find any post abt this.
You don't "create" it; you define a Field in your Table with the AutoNumber
data type.

How were you searching? Searching on "AutoNumber" using Advanced Group
Search at http://groups.google.com found the following numbers of matches:

For USENET newsgroup comp.databases.ms-access: 14,600
For sponsored newsgroup microsoft.public.access: 5,420

Larry Linson
Microsoft Access MVP
Nov 11 '06 #7
Hi Larry .
Create autonumber by field in table, i think it is basic knowlegde.
Basically i need create autonumber in VBA and combine some texts to
make a new value for my control. I am not aware of VBA.
So hope get more help.
Thanks.
Luan.
Larry Linson wrote:
"luanhoxung" <lu********@yahoo.comwrote
but how can i create a autonumber?
[autoid]or[autonumber] is not effective.
Pls teach how to do this ?
i couldnot find any post abt this.

You don't "create" it; you define a Field in your Table with the AutoNumber
data type.

How were you searching? Searching on "AutoNumber" using Advanced Group
Search at http://groups.google.com found the following numbers of matches:

For USENET newsgroup comp.databases.ms-access: 14,600
For sponsored newsgroup microsoft.public.access: 5,420

Larry Linson
Microsoft Access MVP
Nov 18 '06 #8
Anyone tell me what happen with our page:
http://www.talkaboutdatabases.com/gr...ses.ms-access/
I cannot enter.
Luan from Vietnam

Nov 18 '06 #9

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

Similar topics

3
by: Ilan Sebba | last post by:
I have a 'supertype' table with only one field: autonumber. Call this table the 'parent' table. There are two subtypes, 'androids' and 'martians'. Martian have only one thing in common: they give...
33
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
35
by: Traci | last post by:
If I have a table with an autonumber primary key and 100 records and I delete the last 50 records, the next record added would have a primary key of 101. Is there any way to have the primary key...
4
by: yf | last post by:
A KB article "http://support.microsoft.com/default.aspx?scid=kb;en-us;209599" tells that the maximum number of records that a table may hold if the PRIMARY key data type is set to AUTONUMBER is...
26
by: jimfortune | last post by:
Sometimes I use Autonumber fields for ID fields. Furthermore, sometimes I use those same fields in orderdetail type tables. So it's important in that case that once an autonumber key value is...
8
by: petebeatty | last post by:
I have created a SQL string the properly inserts a record in the table. However, the insert does not occur at the end of the table. Instead it inserts a record after the last record that I viewed....
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
1
by: gtwannabe | last post by:
I'm having a problem with a form that uses AutoNumber as the primary key. I have an Abort button to delete the current record and close the form. If AutoNumber is assigned, the code executes a...
9
by: Tom_F | last post by:
To comp.databases.ms-access -- I just discovered, to my more than mild dismay, that some tables in my Microsoft Access 2003 database have duplicate numbers in the "AutoNumber" field. (Field...
6
by: ashes | last post by:
Hi, I am creating an ecommerce website using Microsoft Visual Studio, VB.Net and MS Access 2003. I am new to VB.Net When someone wants to register on the website, they fill out a form and the...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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
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,...

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.