REQ: increase number

  • Thread starter Thread starter Robert
  • Start date Start date
R

Robert

Hi,

I need some advice for my database.
I have a case with an unique number (001-2005). Now i need an unique number
for every item in that case like 001.2005.001, next must be 001.2005.002
etc.
For case number 002-2005 the item must start with 002.2005.001, 002.2005.002
etc.
So i can't use an autonum field.
I tried to use the DMax function but it doesn't work.
It's a multiuser database.
When i create a new item the default value for the case number is set by the
forms default value.

Robert
 
Robert,
You are right that AutoNumber won't suit your purposes, but DMax should
work. To minimize the possibility that two users will hit on the same number
at the same time, you will want to call the function in either the
BeforeUpdate event (if you want to give the users the option of cancelling
the creation of the item) or the AfterUpdate event of a data entry form. I
would suggest that you use 3 separate fields for the three parts of this
number.
 
Lynn,

I use two separate fields, one containing the case number 001-2005 and one
for the item number.
But does DMax work with an item number like 001.2005.001 ?
Can you be more specific about using 3 separate fields and give me a small
example.

Regards,

Robert
 

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

Similar Threads


Back
Top