March 5, 2012 at 9:45 am
I have a form where a user enters a parameter. My button then takes that parameter and calls a SQL Stored Procedure. Everything is working, except I cannot get my return message to display in my text box on the form.
Button Code:
Private Sub Command28_Click()
Dim strSQL As String
Dim returnMessage As String
strSQL = "EXEC SP_PPM_FTE_Append '" & Forms![frmMain]![WhatFiscalYear] & "' , returnMessage"
CurrentDb.QueryDefs("EXECSP_PPM_FTE_Append").SQL = strSQL
DoCmd.OpenQuery "EXECSP_PPM_FTE_Append", acViewNormal, acEdit
boxMessage = returnMessage
End Sub
March 5, 2012 at 2:10 pm
Okay, it looks like you have ReturnMessage as an output parameter in the stored procedure. You need to specify that in the call to the stored procedure. Something like this:
"EXEC SP_PPM_FTE_Append '" & Forms![frmMain]![WhatFiscalYear] & "' , returnMessage OUTPUT"
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply