By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

I have a lame question

P: 4
In the query I need to create a column that would be an automated number
that would read 2007######. How would I do this? I have been doing the
help screen and reading a book on Access, but I just don't get it. Please any
help would be very appreciated. Finished results is a report that would generate this number everytime you print it. The number would work like an Invoice number that would increase everytime you print.

Thanks,
Jhona
Dec 26 '06 #1
Share this Question
Share on Google+
5 Replies


100+
P: 153
please give us an example like would this print out 2007 then 2008 then 2009 or what? Thanks.
Dec 26 '06 #2

100+
P: 1,646
In the query I need to create a column that would be an automated number
that would read 2007######. How would I do this? I have been doing the
help screen and reading a book on Access, but I just don't get it. Please any
help would be very appreciated. Finished results is a report that would generate this number everytime you print it. The number would work like an Invoice number that would increase everytime you print.

Thanks,
Jhona
Hi Jhona,
You will need to create a table that records your invoice activity. You can query the table for the next number and use it in your report. You will need to do this in a code module using VBA.
Dec 26 '06 #3

ADezii
Expert 5K+
P: 8,597
In the query I need to create a column that would be an automated number
that would read 2007######. How would I do this? I have been doing the
help screen and reading a book on Access, but I just don't get it. Please any
help would be very appreciated. Finished results is a report that would generate this number everytime you print it. The number would work like an Invoice number that would increase everytime you print.

Thanks,
Jhona
'Assuming that your Table name is tblTest, and that your automated number is
'contained within the [Rec_ID] field, and the specific formatting of this field is to
'be 2007######, then:

1) [Rec_ID] is to be of the Text Data Type
2) Set your initial Seed value manually to "2007000001"
3) In a Text Box on a Form bound to the [Rec_ID] field set the Default Value to:
="2007" & Right(DMax("[Rec_ID]", "tblTest")+1,6)
4) From this point on, the numbers should be sequential, namely:
2007000001
2007000002
2007000003
2007000004
2007000005
2007000006
2007000007
2007000008
...
2007999999

Have I completely missed the point or does this help?
Dec 27 '06 #4

100+
P: 1,646
'Assuming that your Table name is tblTest, and that your automated number is
'contained within the [Rec_ID] field, and the specific formatting of this field is to
'be 2007######, then:

1) [Rec_ID] is to be of the Text Data Type
2) Set your initial Seed value manually to "2007000001"
3) In a Text Box on a Form bound to the [Rec_ID] field set the Default Value to:
="2007" & Right(DMax("[Rec_ID]", "tblTest")+1,6)
4) From this point on, the numbers should be sequential, namely:
2007000001
2007000002
2007000003
2007000004
2007000005
2007000006
2007000007
2007000008
...
2007999999

Have I completely missed the point or does this help?
This will not increment each time the report is printed
Dec 27 '06 #5

NeoPa
Expert Mod 15k+
P: 31,186
'Assuming that your Table name is tblTest, and that your automated number is
'contained within the [Rec_ID] field, and the specific formatting of this field is to
'be 2007######, then:

1) [Rec_ID] is to be of the Text Data Type
2) Set your initial Seed value manually to "2007000001"
3) In a Text Box on a Form bound to the [Rec_ID] field set the Default Value to:
="2007" & Right(DMax("[Rec_ID]", "tblTest")+1,6)
4) From this point on, the numbers should be sequential, namely:
2007000001
2007000002
2007000003
2007000004
2007000005
2007000006
2007000007
2007000008
...
2007999999

Have I completely missed the point or does this help?
It helps concept-wise but as Will says, will fail in that the increment is never triggered. Something must be done to register printing of an invoice.
Also, the problem of rolling over from one year (2007) to the next (2008) has not been handled in this.
This was not clearly specified in the question mind so what the Original Poster requires in not clear here.
Dec 30 '06 #6

Post your reply

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