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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|