A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Size Access Application on Open



 
 
Thread Tools Display Modes
  #1  
Old July 6th, 2009, 03:15 PM posted to microsoft.public.access.forms
Joe Coulter
external usenet poster
 
Posts: 24
Default Size Access Application on Open

Hi

Can anyone please help me with this one.

I want to size and place the Access application window when a user open a
database I have created, also I would like to hide the database window that
contains the forms, tables and queries etc.

Any help woul be gratefully appreciated


Thanks in advance


Joe
  #2  
Old July 6th, 2009, 03:50 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default Size Access Application on Open

"Joe Coulter" wrote in message
...

I want to size and place the Access application window when a user open a
database I have created, also I would like to hide the database window
that
contains the forms, tables and queries etc.



Hiding the database window is easily done via a startup setting: Tools -
Startup..., uncheck "Display Database Window".

Sizing the Access application window can be done via calls to the Window
API, but Nicole Calinoiu has written a very nice class module to manipulate
form windows, which can also be used to manipulate the application window.
The code can be downloaded he

http://www.mvps.org/access/forms/frm0042.htm
Forms: Move and Resize form windows from code

With that class module in your database, you could manipulate the
application window like this:

Dim fw As New clFormWindow

fw.hWnd = Application.hWndAccessApp

With fw
.Height = 900
.Width = 1200
.Top = 60
.Left = 50
End With

The numbers above are just for example.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

  #3  
Old July 7th, 2009, 07:28 AM posted to microsoft.public.access.forms
Joe Coulter
external usenet poster
 
Posts: 24
Default Size Access Application on Open

Hi Dirk

Thanks for your reply, however I dont fully understand how to work it, I
have done the following:-

Created a new Module called clFormWindow containing the Code from the Nicole
Calinoiu link you suggested, where I am at a loss is wher to place the code
you suggest:-
Dim fw As New clFormWindow

fw.hWnd = Application.hWndAccessApp

With fw
.Height = 900
.Width = 1200
.Top = 60
.Left = 50
End With

Sorry for any inconvience, I am not fully code literate and would appreciate
soem assistance.

Thanks again

Joe

"Dirk Goldgar" wrote:

"Joe Coulter" wrote in message
...

I want to size and place the Access application window when a user open a
database I have created, also I would like to hide the database window
that
contains the forms, tables and queries etc.



Hiding the database window is easily done via a startup setting: Tools -
Startup..., uncheck "Display Database Window".

Sizing the Access application window can be done via calls to the Window
API, but Nicole Calinoiu has written a very nice class module to manipulate
form windows, which can also be used to manipulate the application window.
The code can be downloaded he

http://www.mvps.org/access/forms/frm0042.htm
Forms: Move and Resize form windows from code

With that class module in your database, you could manipulate the
application window like this:

Dim fw As New clFormWindow

fw.hWnd = Application.hWndAccessApp

With fw
.Height = 900
.Width = 1200
.Top = 60
.Left = 50
End With

The numbers above are just for example.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

  #4  
Old July 7th, 2009, 02:02 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default Size Access Application on Open

"Joe Coulter" wrote in message
...

Thanks for your reply, however I dont fully understand how to work it, I
have done the following:-

Created a new Module called clFormWindow containing the Code from the
Nicole
Calinoiu link you suggested,


Be sure that you save this as a class module, not just a standard module.

where I am at a loss is wher to place the code
you suggest:-
Dim fw As New clFormWindow

fw.hWnd = Application.hWndAccessApp

With fw
.Height = 900
.Width = 1200
.Top = 60
.Left = 50
End With


Note that the values I gave there for the various properties are just for
example. You didn't say exactly what you want to do with the application
window, just that you want to manipulate its size and position.

You need to put that code into a procedure that will be run at startup. If
you have a startup form, you could put it into an event procedure for the
form's Open event. That way, at startup Access will open the form, and the
form's Open event procedure will run to execute the code.

If you don't have a startup form, and don't want to create one, then you
could put the code into a function in a standard module, and use an AutoExec
macro to run it (using the RunCode action). But a startup form is easiest
by far.

Sorry for any inconvience, I am not fully code literate and would
appreciate
soem assistance.


I'm happy to help you, but you'll have to let me know what areas give you
difficulty.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

  #5  
Old July 8th, 2009, 07:31 AM posted to microsoft.public.access.forms
Joe Coulter
external usenet poster
 
Posts: 24
Default Size Access Application on Open

Thanks for you reply, It worked a treat, the problem was as you identified, I
had created a Module, Not a Class Module, when I rectified this, you fix
worked perfectly.

Thanks to Nicole Calinoiu

Again Dirk, thanks for your reply and also you patience

Regards

Joe

"Dirk Goldgar" wrote:

"Joe Coulter" wrote in message
...

Thanks for your reply, however I dont fully understand how to work it, I
have done the following:-

Created a new Module called clFormWindow containing the Code from the
Nicole
Calinoiu link you suggested,


Be sure that you save this as a class module, not just a standard module.

where I am at a loss is wher to place the code
you suggest:-
Dim fw As New clFormWindow

fw.hWnd = Application.hWndAccessApp

With fw
.Height = 900
.Width = 1200
.Top = 60
.Left = 50
End With


Note that the values I gave there for the various properties are just for
example. You didn't say exactly what you want to do with the application
window, just that you want to manipulate its size and position.

You need to put that code into a procedure that will be run at startup. If
you have a startup form, you could put it into an event procedure for the
form's Open event. That way, at startup Access will open the form, and the
form's Open event procedure will run to execute the code.

If you don't have a startup form, and don't want to create one, then you
could put the code into a function in a standard module, and use an AutoExec
macro to run it (using the RunCode action). But a startup form is easiest
by far.

Sorry for any inconvience, I am not fully code literate and would
appreciate
soem assistance.


I'm happy to help you, but you'll have to let me know what areas give you
difficulty.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.