From: shm135 on
Hi,

I have a table with two columns: ID, Version.

I would like to make a query that will append a record with the same
ID, but the next consecutive version number.

Example:
ID-Version
1-1
2-1
2-2

If I want to create a new version for ID 1, then the query will create
a new record: 1-2
If I want to create a new version for ID 2, then the query will create
a new record: 2-3

Any help would be appreciated. Thanks!
From: Marshall Barton on
shm135 wrote:
>I have a table with two columns: ID, Version.
>
>I would like to make a query that will append a record with the same
>ID, but the next consecutive version number.
>
>Example:
>ID-Version
>1-1
>2-1
>2-2
>
>If I want to create a new version for ID 1, then the query will create
>a new record: 1-2
>If I want to create a new version for ID 2, then the query will create
>a new record: 2-3
>

INSERT INTO table VALUES([new record ID], Nz(DMax("Version",
"table", "ID = " & [new record ID])) + 1)

--
Marsh
MVP [MS Access]