O
Offace
Hello News Group,
I'm constructing an Access 2003 backend database containing tables and
queries. All queries are SQL expressions, I trying to figure out if I can
insert into a table that has an AutoNumber PK field, via an append query and
retrieve the new number generated by this field in more or less one hit. To
be more precise,
Table1 (or SelectQuery1)
ID (AutoNumber, Random), SomeName (String (120))
Query1
INSERT INTO Table1 ([SomeName])
VALUES ('thename');
Am I able to structure the insert into query such that I can get the new ID
value without another (separate) query to do so? Something like this that
doesn't work (just added it in for semantics)...
INSERT INTO [Table1]
SELECT [ID], thename
FROM [Table1];
Would a sub-query do it?
Thanks for the consideration news group and thanks in advance.
Regards,
Offace.
I'm constructing an Access 2003 backend database containing tables and
queries. All queries are SQL expressions, I trying to figure out if I can
insert into a table that has an AutoNumber PK field, via an append query and
retrieve the new number generated by this field in more or less one hit. To
be more precise,
Table1 (or SelectQuery1)
ID (AutoNumber, Random), SomeName (String (120))
Query1
INSERT INTO Table1 ([SomeName])
VALUES ('thename');
Am I able to structure the insert into query such that I can get the new ID
value without another (separate) query to do so? Something like this that
doesn't work (just added it in for semantics)...
INSERT INTO [Table1]
SELECT [ID], thename
FROM [Table1];
Would a sub-query do it?
Thanks for the consideration news group and thanks in advance.
Regards,
Offace.