X
xilbus via AccessMonster.com
Need help:
I have a form setup to run a report based off of data on that report. The
report needs to know which record its looking at based off of the primary key,
an int value autonumber. The report is setup to run based off of a stored
procedure:
SELECT [Case number]
FROM dbo.Support
WHERE ([Case number] = @Key)
Im using a command button to open the report with this code:
Private Sub Command504_Click()
Dim stDocName As String
stDocName = "report1"
the_key = Me.text1.Value
DoCmd.OpenReport stDocName, acViewPreview
End Sub
the_key is a module item: Public the_key As Integer
from here the report takes over, when it opens it runs this code:
Me.InputParameters = "@Key INT=" & the_key
Here is the problem: The value of @key is going only as far as the input
parameters and is not getting passed successfully into the store procedure.
Can anyone please help me get that value into the stored procedure?
I have a form setup to run a report based off of data on that report. The
report needs to know which record its looking at based off of the primary key,
an int value autonumber. The report is setup to run based off of a stored
procedure:
SELECT [Case number]
FROM dbo.Support
WHERE ([Case number] = @Key)
Im using a command button to open the report with this code:
Private Sub Command504_Click()
Dim stDocName As String
stDocName = "report1"
the_key = Me.text1.Value
DoCmd.OpenReport stDocName, acViewPreview
End Sub
the_key is a module item: Public the_key As Integer
from here the report takes over, when it opens it runs this code:
Me.InputParameters = "@Key INT=" & the_key
Here is the problem: The value of @key is going only as far as the input
parameters and is not getting passed successfully into the store procedure.
Can anyone please help me get that value into the stored procedure?