I have a form that opens a report in a button click event.
DoCmd.OpenReport strReport, acViewPreview
The report has code in the Report_Open event to read a value on the form and change the RecordSource.
In the Report_Load event the following line Sometimes gives me a runtime error 2448. at the following line:
Me!Targetdate = Format(dtmStayDate, "Short Date")
Sometimes I get it when I use this instead:
Me.Targetdate.Value = Format(dtmStayDate, "Short Date")
When I get the error dtmStayDate is always 0. If I set a break in Report_Open, where dtmStayDate is set I almost never get the error. When I do, I never hit the break in Report_Open.
When I traced into Report_Open, one time I discovered the line:
DoCmd.Maximize was causing the code to skip the rest of Report_Open.
I haven't seen the problem since I commented out DoCmd.Maximize in the Report_Open event. (But then as it sometime worked, maybe I haven't tried enough?)
Has anybody seen this? What's going on?
DoCmd.OpenReport strReport, acViewPreview
The report has code in the Report_Open event to read a value on the form and change the RecordSource.
In the Report_Load event the following line Sometimes gives me a runtime error 2448. at the following line:
Me!Targetdate = Format(dtmStayDate, "Short Date")
Sometimes I get it when I use this instead:
Me.Targetdate.Value = Format(dtmStayDate, "Short Date")
When I get the error dtmStayDate is always 0. If I set a break in Report_Open, where dtmStayDate is set I almost never get the error. When I do, I never hit the break in Report_Open.
When I traced into Report_Open, one time I discovered the line:
DoCmd.Maximize was causing the code to skip the rest of Report_Open.
I haven't seen the problem since I commented out DoCmd.Maximize in the Report_Open event. (But then as it sometime worked, maybe I haven't tried enough?)
Has anybody seen this? What's going on?