Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro Helpurgently needed on using Update SQL Command

Status
Not open for further replies.

kensaffer

Programmer
Jan 7, 2005
39
US
I've writtema macro that executes a stored procedure as well as writing the stored procedure.
Here's the SP in my VBA
DoCmd.OpenStoredProcedure "dbo.change_mrn_alltables_sp"
the procedure is :
Alter PROCEDURE dbo.Change_MRN_AllTables_SP @OLD_MRN_TO_BE_CHANGED varchar(25) , @NEW_MRN varchar(25)
AS
update accountstbl set MRN = @NEW_MRN where mrn = @OLD_MRN_TO_BE_CHANGED

When I run I get message:
RUN TIME ERROR "2001"
You cancelled the previous operation
I'm lost and spent over 5 hours on this>

If I run as macro executing the stored procedure the code is...
DoCmd.RunMacro "change_mrn"
and the macro executes the stored procedure BUT I get message
Action Failed
Condition = True
Action name:Openstoredprocedure
Arguments: dbo.change_mrn_alltables_sp,print preview,edit

Please help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top