Hello,
I'm working with Access 2010 and SQL Server 2014.
I have a problem with report and sub report which were based on an SQL Server stored procedure.
Main report works perfect.
Problem is with subreport.
I have seen on Google search that I can't work with stored procedure on a sub report (this only work with ADP). Must use subform instead.
I have added the following code on the Open Event of the subform.
Private Sub Form_Open(Cancel As Integer)
Dim cmd As New adodb.Command
With cmd
.ActiveConnection = cn
.CommandText = "pr_myStoredProc"
.CommandType = adCmdStoredProc
.Parameters.Refresh
.Parameters("@EndDate") = Forms!frmForm!TbxEndDate
Set Me.Recordset = cmd.Execute
End With
Set cmd = Nothing
End Sub
"Link Master Fields" and "Link Child Fields" are set to a field named "CustomerSiteID", which is a part of the main report.
As a result, my sub form never give me records.
Could you help me please ?
Many thanks in advance.
Chris.