Solved

Window Size

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
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.

920 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

17 Experts available now in Live!

Get 1:1 Help Now