Hi, I'm trying to create a report using a template and then set it's recordsource. I have tried
but even though the template report exists and I have spelt it correctly I always end up with a blank report.
So now I have tried
Both times I open the report using
but although it does create a report using the template on opening it asks for a Parameter called Number which doesn't match up to any parameter on the report...... Also (it is creating an exam paper) it puts the questions in a wierd order (always 16,2,3,4,5,6,7, 8,9,10,11,12,13 ,14,15,1,30,17, 18,29,20,21,22, 23,24,25,26,27, 28,19)
I'd prefer to use the CreateReport method as it seems cleaner to me but can anyone help?
Code:
Set rpt = CreateReport( , strTemplate) rpt.RecordSource = strQTableName
So now I have tried
Code:
DoCmd.CopyObject , strQReport, acReport, strTemplate DoCmd.OpenReport strQReport, acViewDesign, , , acHidden Set rpt = Reports.Item(strQReport) rpt.RecordSource = strQTableName DoCmd.Close acReport, strQReport, acSaveYes
Code:
DoCmd.OpenReport strQReport, acViewPreview, , , acWindowNormal
I'd prefer to use the CreateReport method as it seems cleaner to me but can anyone help?
Comment