Newbie Needs Help - Finding last number in a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear Helpful users,
As a Newbie to ACC2000 I have created a dB for our Service Dept where we
record Customer details in one table and Repair details in another.
So far so good. I now want to create new records with a sequential number
automatically, doing it manually at present. I have in the Customer table a
record with a 4 digit number (from the old paper system) that I want to
increment for each new record.
What I can't seem to find in the Help and Ref and a lot of searching of this
forum is a way to find the highest number in the Customer table. For Example:
Customer | Record# | Other details
Fred | 1234
Jim | 1235
Bill | 1236 <--------- Need to find this number

Once I have found this number I can add 1 to it and use it for this field in
the table for a new record.

Any help offered is greatfully acknowledged

Chas
 
Just been doing some more searching and found the MAX function in a query.
Great this gives me the last number in the list but now I don't know how to
get this into VBA so I can add the one to it. Guess this Post should really
be in the VB programming group - Sorry.
 
Dear Allen
Thanks, that works great. I looked for this on your tips site but could not
locate.
Anyway thanks again.
Chas
--
Spectrum is Green


Allen Browne said:
Try:
DMax("[Record#]", "Table1")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Chas Large said:
Just been doing some more searching and found the MAX function in a query.
Great this gives me the last number in the list but now I don't know how
to
get this into VBA so I can add the one to it. Guess this Post should
really
be in the VB programming group - Sorry.
 

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

Back
Top