Learn how to a build a cloud-first strategyRegister Now


Setting a window to a certain position on my screen

Posted on 2006-06-02
Medium Priority
Last Modified: 2008-02-26
Hi experts,

When I click on my print preview command button, the correct report opens up but over the top of the form that has the command button on it.  I would like to click the report command button and have the print preview window set to a certain size and in a certain position on the page.  For example, how would I set up the code so that the print preview window only opened from the middle of the screen to the right hand side of the screen?

Thank you for any help.

Question by:TerenceHewett
  • 4
  • 3
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 16817469
in the open event of the report

docmd.movesize <right value>, <down value>      'values is in twips

     docmd.movesize 10000, 500

Author Comment

ID: 16871565
Hi Capricorn, sorry for the delayed response.  I have tried your suggestion, but this does not work.  Any suggestions as to why?  I have tried in the OnOpen of the report and also the OnFormat of the report, but no joy.

Kind regards,
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 16872609

did you try it like this

Private Sub Report_Open(Cancel As Integer)

DoCmd.MoveSize 10000

End Sub
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 16933066
Thanks Cap for the help.  I tried your later suggestion and it worked.


PS: Apologise for the delay in awarding points.

Author Comment

ID: 16940444
Hi Cap.

I thought this had worked, but it had not.   I have tried creating a macro with the movesize command also but this has not worked either.  I have no idea what I am doing wrong.  In the Access help it says that it is possible to MoveSize in reports, but it is not working for me.  The report opens in full screen print preview and when I click the very top left corner (app icon) the Move and Size are greyed out.  Can anybody help?

Thank you.

PS: I will repost if that is preferred.
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 16941493
<report opens in full screen print preview>

if it is maximized, you won't see it moved. there should be enough space to the right.
try resizing it.

LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 16941854
try this

private sub cmdPreview_click()          '<< just  change the name of the command button

dim sRep as string
srep="NameOfReport"          '<<< change the name of the report

docmd.openreport, srep, acviewpreview
docmd.movesize 10000

end sub

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question