Solved

Window Size

Posted on 2004-04-23
4
2,250 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
Comment Utility
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
Comment Utility
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
Comment Utility
Yup that's the other way to go.
Well done.

0
 

Author Comment

by:silsuba
Comment Utility
Thanks Walt... right on the money.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

763 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

8 Experts available now in Live!

Get 1:1 Help Now