Solved

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

Posted on 2013-11-16
2
431 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now