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
Solved

Set window position in access

Posted on 2001-09-17
3
215 Views
Last Modified: 2006-11-17
Hi,

I am trying to set a window position for access forms. From visual basic I know a form.top and form.left property- which I unfortunately cannot find here. What are my options?

The actual window I want to position is the MS Access mother window, NOT the child form. I reckon this complicates it even more? ;) We love challenges, dont we?

Any help appreciated,
Best regards,
Nite
0
Comment
Question by:NiTech
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
TarekEslim earned 100 total points
ID: 6487023
Well,

I know one way wich is working 100%. It uses the APIs.
Declare the MoveWindow API as follows:

Declare Function MoveWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long


and in your form you can set this code:

Dim retval As Long  ' return value
' Move the window and make sure it's redrawn at its new
' position.

retval = MoveWindow(Application.hWndAccessApp, 200, 150, 175, 300, 1)

' You can use any x,y,width,hight values you want

' (If the last value had been 0, the window would have appeared to be unmoved!)
Regards


Tarek
0
 

Author Comment

by:NiTech
ID: 6487053
Where is the function declaration loaded in Access? Is there a special 'file' within the modules that has to contain the code? or can I just put it in the top of a form which I know will be loaded sooner or later?

regards,
Nite
0
 

Author Comment

by:NiTech
ID: 6560441
Thanks, great.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

809 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