Access 2000 & DMax Function

L

Larry H.

Hi,
I have a 1000 record database that inside each record is
found a "Counter number 0 - 9999 is the range". The
counter number can be duplicated and the FORM that I am
wanting to use the DMax function IS NOT sorted into
the "counter number" sequence which makes it almost
impossible to know the next number to use for NEW data.

When I click the option to "creat a NEW record", I would
like to have a field that shows on the FORM that would
tell me the LARGEST "counter number" that I have used
thus far and, if possible ADD 1 to that number for
display purposes.

The field is nameed "Counter number" and I want to put
the DMax number found in a field called "Next Number".
The name of the Table is "larryData".

Could someone please give an example of how to do this
with DMax or any other method that I could use to
accomplish this task....

H E L P !!!
Searching,
Thanks....
Larry H.
 
A

Albert D. Kallal

You could use the on-insert event of the form.

Since on-insert does not get called unless it is a new record, then the
following should work:

me![counter number] = dmax("[counter number]","yourTableName") + 1
 
L

Larry H.

Thanks Albert,

I will be trying this today. I really appreciate your
help. The newsgroups are wonderful.

Thanks again,
Larry H.
 

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