Solved

Set window position in access

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

757 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

18 Experts available now in Live!

Get 1:1 Help Now