Solved

make a report to open to the right of...

Posted on 2013-11-16
2
437 Views
Last Modified: 2013-11-17
In a two screens setting; the form opens in the large screen. But. upon dbl-click on a label on a the form an expected report opens in the smaller screen not on the top of the form where I am trying to get it opened.

FYI, the report is only 2 inches wide and opens in  dialog mode. This report is best to open 3 inches from the left edge of the form in the large screen as well.

Question: How can I change the following code (possibly passing the left position of the report as OpenArgs)?

DoCmd.OpenReport "report1", acViewReport,,, asDialog

Or, do something in the open/ load event of the report to sense the left-position of the form to position itself 3 inches to right of it.

All works fine except that the report opens up in the laptop monitor (smaller screen) not in the large screen.

Thank you.
0
Comment
Question by:Mike Eghtebas
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39654433
You can use DoCmd.MoveSize to position an object:

DoCmd.MoveSize 250, 300

This would position the object at 250 (inches, centimeters, etc) to the right of the Access window, and 300 in/cm down from the top of the Access window. If you want to position it beside another object, you'd have to get that object's position first, and use that. For example, if I wanted to put it beside a form named "fUser", I'd do this:

Dim iRight As Integer
Dim iDown as Integer

iRight = Forms("fUser").WindowLeft + Forms("fUser").Width
iDown = Forms("fUser").WindowTop

DoCmd.MoveSize iRight, iDown

You would do this in the Load or Open event of your report.

See this Help topic:
http://msdn.microsoft.com/en-us/library/office/aa210274(v=office.11).aspx
0
 
LVL 33

Author Closing Comment

by:Mike Eghtebas
ID: 39655095
Thank you very much. I wonder if you have the time to take a look at:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28296603.html

Mike
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 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