Solved

Set window position in access

Posted on 2001-09-17
3
220 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
[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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

630 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