A
AkAlan via AccessMonster.com
I can get this stored procedure to run when I call it manually but not with
VBA. Here is the code:
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Dim prm As ADODB.Parameter
Dim strJcn As String
Set cnn = CurrentProject.Connection
Set cmd = New ADODB.Command
strJcn = "'" & Me![STATUS_ESR_JCN] & "'"
Set cmd.ActiveConnection = cnn
cmd.CommandText = "pr_ReOpenEsr"
cmd.CommandType = adCmdStoredProc
Set prm = cmd.CreateParameter("@Jcn", adBSTR, adParamInput, , strJcn)
cmd.Parameters.Append prm
cmd.Execute
It runs through with no error, it just doesnt delete the two date fields I
want it to. I run another sp almost exactly like this one for a subform and
it runs just fine the only difference is that the parameter for that one is
an integer.
Here is the pr_ReOpen sp SQL :
UPDATE dbo.ESR
SET ESR_CLOSE_DATE = NULL, ESR_CLOSE_TIME = NULL
WHERE (ESR_JCN = @JCN)
I have tried it without the single quote around the strJcn variable and same
thing. Thanks for your help.
VBA. Here is the code:
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Dim prm As ADODB.Parameter
Dim strJcn As String
Set cnn = CurrentProject.Connection
Set cmd = New ADODB.Command
strJcn = "'" & Me![STATUS_ESR_JCN] & "'"
Set cmd.ActiveConnection = cnn
cmd.CommandText = "pr_ReOpenEsr"
cmd.CommandType = adCmdStoredProc
Set prm = cmd.CreateParameter("@Jcn", adBSTR, adParamInput, , strJcn)
cmd.Parameters.Append prm
cmd.Execute
It runs through with no error, it just doesnt delete the two date fields I
want it to. I run another sp almost exactly like this one for a subform and
it runs just fine the only difference is that the parameter for that one is
an integer.
Here is the pr_ReOpen sp SQL :
UPDATE dbo.ESR
SET ESR_CLOSE_DATE = NULL, ESR_CLOSE_TIME = NULL
WHERE (ESR_JCN = @JCN)
I have tried it without the single quote around the strJcn variable and same
thing. Thanks for your help.