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

Autonumbering based on criteria

P: 2

Please forgive me if I use the wrong terminology, I will do the best I can. I am a self-taught Access uses and cueently creating a database for the firm I work for. Part of its function will be to generate logging numbers for incomming and outgoing correspondence. At the moment I have that happening as a simple autonumber that each piece of correspondence regardless of the project is related to gets logged in sequence. My question is this...

Is there a way to make the autonumbering count at different points for different projects? ie if project 05-114 might have had 500 piece of correspondence so we want the next log number to be 501 and project 04-127 might have had 200 pieces so we want the next number to be 201, but I want all the data held in one table for easy of queries etc.

If you can help of point me in the right direction I'd be most grateful.

Dec 15 '06 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 15k+
P: 31,660
AutoNumbering doesn't do that for you.
You will need to have some code inserted at the point of creation (appending) which uses DMax() to finds the highest number so far for the group that it's a member of.
This could be in addition to the AutoNumber field which can still be the Primary Key.
Dec 15 '06 #2

P: 2
Thank you, I think I understand, will give it a go
Dec 15 '06 #3

Expert Mod 15k+
P: 31,660
Thank you, I think I understand, will give it a go
Come back if you get stuck.
We do details too - but only where required ;).
Dec 15 '06 #4

Post your reply

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