Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Setting a window to a certain position on my screen

Posted on 2006-06-02
7
Medium Priority
?
215 Views
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.

Terry
0
Comment
Question by:TerenceHewett
  • 4
  • 3
7 Comments
 
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

try
     docmd.movesize 10000, 500
0
 

Author Comment

by:TerenceHewett
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,
Terry
0
 
LVL 120

Accepted Solution

by:
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
0
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

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

Regards,
Terry

PS: Apologise for the delay in awarding points.
0
 

Author Comment

by:TerenceHewett
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.
Terry

PS: I will repost if that is preferred.
0
 
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.

0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 16941854
Terry,
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
reports(srep).zoomcontrol=50
docmd.movesize 10000

end sub
0

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