Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Set window position in access

Posted on 2001-09-17
3
Medium Priority
?
224 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 400 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

772 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