Stored procedure returns no records - handling error message.

In my ADP I have a form with button.  When the button is clicked, a stored procedure is run that updates a table in the SQL Database.  This is what I want it to do, and it works just fine.   BUT, I also get a popup box that reads "stored procedure executed but did not return records".    Click OK and it goes away, but I'd prefer if it didn't appear at all, since I'm not expecting my stored procedure to return records.

I'm calling the SP with DoCmd.OpenStoredProcedure

Perhaps there is another way to call it so that it doesn't expect to return records?
Or, is there a way to suppress the error message?  I can't figure out what the error number is.  I put in error handling code but it's not being caught by that.

Thanks!
LVL 1
rsobleAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Data-ManConnect With a Mentor COOCommented:
Try putting

DoCmd.SetWarnings False
DoCmd.OpenStoredProcedure
DoCmd.SetWarnings True

Mike
0
 
rsobleAuthor Commented:
Great, thanks!  And so fast too :-)
0
 
Data-ManCOOCommented:
13 minutes is slow for this forum...Glad I could help....Mike
0
 
shanesuebsahakarnCommented:
Hmm, how about:
CurrentDb.Execute "Exec MyStoredProcedure"
0
 
rsobleAuthor Commented:
>> Hmm, how about:
>> CurrentDb.Execute "Exec MyStoredProcedure"

Just for curiosity's sake I tried this too but it didn't work.  Resulted in a MsgBox popup with a blank message.
Thanks.  The other solution may be clunkier but it works fine for me.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.