The instruction was working good when the report was opened in layout mode and in preview mode it only complained that it couldn't be altered in preview mode, not that it dind't exist. The report has been created from a form so it has a number of Subform/Subreport which are in datasheet view.
Anyway, right now I left the column resizing aside for now and was trying to settle with hiding the subforms that don't have any data and move the rest together so they take up less space (hopefully taking no more than 1 page in landscape). The hide part is working great both in preview and normal views, the moving part not so much. So here is my train of thought. I could start by the y axis (top property) position of the first form, and for every subform with data (which are set to 'can shrink' and do so perfectly depending in the number of records), move it to that y position, and increase the position by the inner height of the form and a bit of extra space to move the next subform with data to that position and so on. But if I try the following:
Code:
ctrol.Move 113, posY, ctrol.Form.InsideWidth, ctrol.Form.InsideHeight
with 113 being the fixed x axis position (left property) for each form, I get a 2113 "The value you entered isn't valid for this field" in preview mode (yes, the y position is calculated in twips too), and in normal mode it just terminates without error and without printing anything, as with the column resizing code. If i move the form instead of the control though
Code:
ctrol.Form.Move 113, posY, ctrol.Form.InsideWidth, ctrol.Form.InsideHeight
no error is thrown but the forms just don't move, they preview or print as if the code wasn't there (even though the code is executing and adjusting the posY value properly, as checked through msgboxes). I've had no luck finding a similar problem to mine. Any ideas?