Solved

Window Size

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

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.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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 …
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.

730 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