Set size of report

Actually after looking at it again I think I know what's happening there. Try this:
Code:
dim ileft as long, itop as long

docmd.openreport ...
with reports("report name")
    ileft = .left
    itop = .top
    .move 0,0,10,10
    .move ileft, itop, Widthscr, Heightscr
end with
If this works, you can change the last move line with your Left and Top values.
 
Even when you replace the Left and Top values with your variables?
 
I restored the movesize statement in the on load event.
 
Code:
DoCmd.OpenReport "rptBaseschedule", acViewPreview
Reports("rptBaseschedule").Move Leftscrpos, Topscrpos, Widthscr, Heightscr

and Auto Resize = Yes, the report looks right, but it's in the wrong place.
 
You already mentioned this in post #16 which has my other responses till this post. No point in repeating yourself.

If we can't see the database then we can't spot the problem.
 
Attached is a sample. I want the report to open in the same position as the form.
 

Attachments

I'm trying to get the report to open below the main form.
 
goodfu, you need to be consistent with your problem. This isn't a helpdesk.
 
I'm sorry if my previous post confused you. I have a form with 2 buttons on it. One on them opens a form below the form. That's good. The other button opens a report much further down and to the right. I want to change that so the report opens below the form with the buttons on it, just like the form that opens below the form with the buttons on it.
 
Wouldn't it be a simple matter of adding the form's height to the Top argument?
Code:
Private Sub Command0_Click()
    DoCmd.OpenReport "Report1", acPreview
    Reports("Report1").Move Me.WindowLeft, Me.WindowTop[COLOR=Red][B] + Me.WindowHeight[/B][/COLOR], Widthscr, Heightscr
End Sub
 

Users who are viewing this thread

Back
Top Bottom