childrenfirst
Technical User
Hi,
I have a stored procedure that runs after Access form passes the global variables to SQL. New records will be inserted into a SQL table at the end of the stored procedure and the primary key for the table is an auto-id. I would like to pass the auto-id inserted into this SQL table back to the Access form, but I am not sure how to do it.
Right now, my stored procedure looks like this:
CREATE PROCEDURE s_SelectRandomClaim
@globalvariable1 int,
@globavariable2 varchar(20)
AS
@reportnum
blah... blah...
blah... blah...
--return value of the newly inserted row in identify field in ClickonAuditlist table
SELECT @ReportNum = SCOPE_IDENTITY()
GO
My problem is that how do I retrieve the value of @Reportnum from vba Access? I have never written any vba code to do this job before and really have no idea. Any help will be greatly appreciated!!
Thanks a bunch!
I have a stored procedure that runs after Access form passes the global variables to SQL. New records will be inserted into a SQL table at the end of the stored procedure and the primary key for the table is an auto-id. I would like to pass the auto-id inserted into this SQL table back to the Access form, but I am not sure how to do it.
Right now, my stored procedure looks like this:
CREATE PROCEDURE s_SelectRandomClaim
@globalvariable1 int,
@globavariable2 varchar(20)
AS
@reportnum
blah... blah...
blah... blah...
--return value of the newly inserted row in identify field in ClickonAuditlist table
SELECT @ReportNum = SCOPE_IDENTITY()
GO
My problem is that how do I retrieve the value of @Reportnum from vba Access? I have never written any vba code to do this job before and really have no idea. Any help will be greatly appreciated!!
Thanks a bunch!