Solved

Window Size

Posted on 2004-04-23
4
2,275 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

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…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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…
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 …

813 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

10 Experts available now in Live!

Get 1:1 Help Now