Solved

Window Size

Posted on 2004-04-23
4
2,283 Views
Last Modified: 2012-06-21
I'm almost embarassed to be asking this question, but here goes..

I want to size the Access application window when it opens,  I found the below message with code to do this.  TheAmigo says to put this in the startup.  Where exactly is that?

Accepted Answer from TheAmigo
Date: 03/07/2003 09:57AM PST
 Accepted Answer  


Add this code to your startup:

Private Declare Function MoveWindow Lib "user32" (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

MoveWindow Access.Application.hWndAccessApp, 20, 30, 600, 300, 1


Not very difficult, sorry for the basic question.


0
Comment
Question by:silsuba
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
walterecook earned 250 total points
ID: 10899108
Here's how I did it.
Paste this into a module:

Private Declare Function MoveWindow Lib "user32" (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

Public Function sizeIt()
MoveWindow Access.Application.hWndAccessApp, 20, 30, 600, 300, 1
End Function


Then create a macro called "Autoexec"
1 line in it:
RunCode
At the bottom (where it says function name) put "Sizeit()"

That ought to get you going.
Walt
0
 
LVL 17

Expert Comment

by:aflockhart
ID: 10899141
Access lets  you designate one form to be opened at system startup (Tools, Startup)

You can create a macro to run when this form is opened.

(Form properties, events, OnOpen  : select "Event Procedure" and click the [..] button

THen copy and paste in the code that you want to run.

You can leave the form open (maybe with a menu on it) or close it down by adding a Close command
0
 
LVL 17

Expert Comment

by:walterecook
ID: 10899377
Yup that's the other way to go.
Well done.

0
 

Author Comment

by:silsuba
ID: 10899657
Thanks Walt... right on the money.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

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…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
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 different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

860 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