Solved

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

Posted on 2013-11-16
2
442 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

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 34

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

717 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