From: BobC on
I have a table in which the ID is NOT 'autonumbered'(no repetitions) and
I want to find out what the last ID used was so I can increment it in
order to add other records. By 'last record', I am referring to the
record that shows up last in datasheet view.
From: Steve on
If ID is numeric, use the DMax function and add 1.

Steve
santus(a)penn.com


"BobC" <Bob.CallenNoSpamm(a)cox.net> wrote in message
news:60OBm.36826$tG1.14013(a)newsfe22.iad...
>I have a table in which the ID is NOT 'autonumbered'(no repetitions) and I
>want to find out what the last ID used was so I can increment it in order
>to add other records. By 'last record', I am referring to the record that
>shows up last in datasheet view.


From: Jeff Boyce on
Bob

"last in datasheet view" is meaningless! If you sort that datasheet
according to one field, one record shows up "last". If you reverse that
sort (sort Descending), a different record shows "last". If you use a
different field, yet another could show up "last".

You'll need to define/decide what sorting criterion/criteria you want
applied.

Access does find a "Last", but that's whatever (internal, hidden, non-human)
order Access decides to use -- humans rarely get what they're after if they
use the Access "Last"...

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"BobC" <Bob.CallenNoSpamm(a)cox.net> wrote in message
news:60OBm.36826$tG1.14013(a)newsfe22.iad...
>I have a table in which the ID is NOT 'autonumbered'(no repetitions) and I
>want to find out what the last ID used was so I can increment it in order
>to add other records. By 'last record', I am referring to the record that
>shows up last in datasheet view.


From: Jeff Boyce on
(NOTE: Steve's response provides a method if the field is numeric, AND if
you are after the largest value)

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"BobC" <Bob.CallenNoSpamm(a)cox.net> wrote in message
news:60OBm.36826$tG1.14013(a)newsfe22.iad...
>I have a table in which the ID is NOT 'autonumbered'(no repetitions) and I
>want to find out what the last ID used was so I can increment it in order
>to add other records. By 'last record', I am referring to the record that
>shows up last in datasheet view.


From: BobC on
Thank You Steve!
I know did not do a good job with describing 'last', but what you gave
me works great!
Bob

Steve wrote:
> If ID is numeric, use the DMax function and add 1.
>
> Steve
> santus(a)penn.com
>
>
> "BobC"<Bob.CallenNoSpamm(a)cox.net> wrote in message
> news:60OBm.36826$tG1.14013(a)newsfe22.iad...
>> I have a table in which the ID is NOT 'autonumbered'(no repetitions) and I
>> want to find out what the last ID used was so I can increment it in order
>> to add other records. By 'last record', I am referring to the record that
>> shows up last in datasheet view.
>
>