Add Records Sequentially with DMAX

  • Thread starter dancox via AccessMonster.com
  • Start date
D

dancox via AccessMonster.com

Where is the proper place in my form to add the following

Area Table CostCodeLast3 CostCode
1000 001 10-001
1100 001 11-001
1200 001 12-001
002 12-002
003 12-003

I want the next cost code to pop up after I enter the area in a new record.
I know how to combine the last 3 with the first 2 numbers of the area.
I don't know how to make the code select the next last 3 for area.
 
M

Maurice

Dan,

I don't know the what the Dmax is for but if you are looking for
concatenation put this in a query:

CostCode: left([area table];2)&right(CostCodeLast3;3)

That should give you the outcome you are looking for.

hth
 
D

dancox via AccessMonster.com

I probably didn't explain clearly. I can do the concatenation, but first I
need to add to the previous number when I add a new record. 001, 002, 003
based on selecting the areas.

I have 10 areas and each starts at 001. I need the form to go find the last
number for that area. ie. 12-301 add new record 12-302.

I said:
Dan,

I don't know the what the Dmax is for but if you are looking for
concatenation put this in a query:

CostCode: left([area table];2)&right(CostCodeLast3;3)

That should give you the outcome you are looking for.

hth
Where is the proper place in my form to add the following
[quoted text clipped - 8 lines]
I know how to combine the last 3 with the first 2 numbers of the area.
I don't know how to make the code select the next last 3 for area.
 

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