I have created a crosstab query that requires "DTWKEND" date/time parameter. I created a report for this crosstab query but do not set the report recordsource until the OnOpen Event of the report because I can't work on the report when its recordsource is set to the qry as it keeps prompting me for DTWKEND over and over and over and over. So, the user will access this report from a form.
The execution of this code receives the following error
2102 The form name 'RptGROUP_TS' is misspelled or refers to a form that doesn't exist.
I double-checked, the report is named that. So I figure it's because it is based on that crosstab query and the sLINKCRIT in the code is not getting the parameter to that underlying Query for the report. So I am looking for the proper method of passing the parameter from the form to the report/report's query recordsource if the recordsource is not set until the OnOpen event.
Thanks,
J9
Code:
Dim sLINKCRIT As String
sLINKCRIT = "DTWKEND=#" & Me.DtWkEnd & "#"
sDOCNM = "RptGROUP_TS"
DoCmd.OpenForm sDOCNM, , , sLINKCRIT
The execution of this code receives the following error
2102 The form name 'RptGROUP_TS' is misspelled or refers to a form that doesn't exist.
I double-checked, the report is named that. So I figure it's because it is based on that crosstab query and the sLINKCRIT in the code is not getting the parameter to that underlying Query for the report. So I am looking for the proper method of passing the parameter from the form to the report/report's query recordsource if the recordsource is not set until the OnOpen event.
Thanks,
J9