Solved

Set window position in access

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

Technology Partners: 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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

734 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