Hi All
WinXPPro
Access 2002 SP3
I'm doing an INSERT to a table by building an SQL String and then executing it with :-
CurrentDb.Execute(SQL_String)...
Works marvellously! I want to retrieve the record number that the INSERT created and I suspect that there is an easy way to do it wihtout me writing tons of queries. I've experimented with calling
CurrentDb.Execute("SELECT @@IDENTITY") immediately afterwards but it fails either because
"CANNOT EXECUTE A SELECT QUERY"... or if I call it by opening a recordset query the connection has closed and the new record number is lost.
Can anyone help please?
Thanks
WinXPPro
Access 2002 SP3
I'm doing an INSERT to a table by building an SQL String and then executing it with :-
CurrentDb.Execute(SQL_String)...
Works marvellously! I want to retrieve the record number that the INSERT created and I suspect that there is an easy way to do it wihtout me writing tons of queries. I've experimented with calling
CurrentDb.Execute("SELECT @@IDENTITY") immediately afterwards but it fails either because
"CANNOT EXECUTE A SELECT QUERY"... or if I call it by opening a recordset query the connection has closed and the new record number is lost.
Can anyone help please?
Thanks