Hi everyone, I am currently at a halt right now on enhancing my report printout. On my previous version I have a color picker form for custom color selection as a separate window that will update the font colors of the fields/controls on a second window for report (in report view). But I decided it would look better to have one form with color picker form being the parent form and report as a SubReport on the form so that way it would be more intuitive for the FE users to use.
However, in doing so, whenever the main form is loaded (the report which gets loaded first doesn't trigger onLoad event that calls for another procedure(s) to dynamically update the report fields). And after everything is loaded, I have to manually click onto the subreport in order to get this onLoad even fired. In addition, now any controls referenced from the procedures called by onLoad of the report events trigger the 2467 error when trying to edit caption or text on the label or text controls (not sure if same for cells if trying to modify the width/height etc...) EXCEPT the SubReport report(s) of the main report.
I've tried to explicitly reference the controls on the report like [Reports]![report_name]![control_name].Caption or .value or .text but no luck.
Is there anyway to resolve this? I've thought of moving this procedure out of the report and onto the parent form to see if it works but that would be rewriting. Please see below for my short sample codes...
What I tried is I did iteration by dimming a ctl to go through the controls collection on the report and print out the label and text control values/caption to the immediate window and it works fine.Code:On clicking accept new color from Color Picker form as a separate window: this will iterate through the Report Window to update the font colors... and I kept the same codes when adding the main report to the main form under subform of the main form. On Report Form:onLoad: (doesn't auto trigger when the report is loaded as a subForm/Report on the color picker form - otherwise this works fine if it was opened as a separate window)Call setEnvironPrivate Sub setEnviron()Select Case Me.txtRequestTypeCase "New Test", "New Custom Panel"Call setEnvironNewCase "Discontinuation", "Result Code Addition"Call setEnvironDiscCase Else' Do nothing, use default report page setupEnd Select Call verifyElementsEnd Sub Private Sub verifyElements()Here I've just included a sample to where it gives the error With MeIf .childCurrentTestComps.Report.Controls("txtCount") = 0 And .childNewTestComps.Report.Controls("txtCount") = 0 Then Here the if statement recognized the subReport control and its' report's control "txtCount"Starting the line in blue gives the error..lblCurrentTestComp.Caption = .lblNewTestComp.Caption ...End If ... more codesEnd WithEnd Sub
So I'm really not sure what's going on. Hopefully what I put out made sense... I'll try my best to explain it.
Thank you again!