assign number to new record

  • Thread starter Slez via AccessMonster.com
  • Start date
S

Slez via AccessMonster.com

I am creating a form which is an entry point for the "many" side of a one-to-
many relationship. The end result is that the mainform would containg a
listbox of available projects based on a field called JobNumber (this is on
the "one" side of the relationship. The field PunchID would be on the "many"
side of the relationship. An examples of how the records would appear is:

JobNumber PunchID
065555 001
065555 002
065555 003
...and so on...
065571 001
065571 002
...and so on...

You can see that the PunchID for each JobNumber starts with 001.

What I'd like to accomplish is that the new record equals the last record +1,
sort of like an autonumber, so that users don't have to number themselves.
Is there an expression, code, or a property set that would allow me to do
this?
Thanks in advance for any help!
 
L

lillestol1763

Slez said:
I am creating a form which is an entry point for the "many" side of a one-to-
many relationship. The end result is that the mainform would containg a
listbox of available projects based on a field called JobNumber (this is on
the "one" side of the relationship. The field PunchID would be on the "many"
side of the relationship. An examples of how the records would appear is:

JobNumber PunchID
065555 001
065555 002
065555 003
..and so on...
065571 001
065571 002
..and so on...

You can see that the PunchID for each JobNumber starts with 001.

What I'd like to accomplish is that the new record equals the last record +1,
sort of like an autonumber, so that users don't have to number themselves.
Is there an expression, code, or a property set that would allow me to do
this?
Thanks in advance for any help!

Slez,

I think you want to look at the DMAX function:

http://msdn.microsoft.com/library/d...-us/vbaac11/html/acfctDMinDMax_HV05187184.asp

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top