473,513 Members | 2,454 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I center Access 2007 switchboard opened to full screen?

26 New Member
I am creating a database in Access 2007 for multiple users, some with very limited experience with access. I am using a customized switchboard to make it more user-friendly.

I have the switchboard opening to full screen (covers all of the access window) and it is centered on my laptop but when I open the database on a different computer, different monitor size and resolution, it is not centered.

Is there anyway to have the switchboard centered, no matter the monitor size/resolution when opening to full screen?
Oct 6 '11 #1
28 11901
ADezii
8,834 Recognized Expert Expert
You can always make sure that a Form is Centered regardless of a User's Screen Resolution, but the Code is a little complex, and I do not believe that the Form can be Maximized. If you wish to see how this can be done, just let me know.
Oct 6 '11 #2
NeoPa
32,557 Recognized Expert Moderator MVP
Have a look at the AutoCentre property of the form.
Oct 6 '11 #3
JAGster
26 New Member
ADezil, I appreciate the offer on the code but I feel it necessary to have the switchboard opened to full screen for security and to avoid overwhelming users unfamiliar with Access.

NeoPa, The AutoCentre property is set to yes, but the form is not centered.

Thanks for the ideas. Any others will be greatly appreciated.

Regards, JAGster
Oct 6 '11 #4
ADezii
8,834 Recognized Expert Expert
@JAGster: Kindly explain...
I feel it necessary to have the switchboard opened to full screen for security and to avoid overwhelming users unfamiliar with Access.
Oct 7 '11 #5
JAGster
26 New Member
ADezii,
I am concerned that inexperienced Access users will be confused/intimidated by the Access menus on the ribbon. I am also concerned about securing the database from tampering, inadvertent or otherwise.

I read a little bit of Rabbit's post on Securing a Database in Access and will look into the methods descrbed there for securing the database.

I am very interested in learning how to center forms, regardless of screen resolution. Thanks, JAGster
Oct 7 '11 #6
ADezii
8,834 Recognized Expert Expert
How, exactly, are you Opening the switchboard to Full Screen?
Oct 7 '11 #7
JAGster
26 New Member
I got this from Jim Doherty's reply to an old post

min max buttons none
Borderstyle none
popup yes
navigation buttons no
Recordselectors no
scrollbars neither

In the on load event entered the code - DoCmd.Maximize
Oct 7 '11 #8
JAGster
26 New Member
The form is triggered to open from the Autoexec macro.
Oct 7 '11 #9
NeoPa
32,557 Recognized Expert Moderator MVP
So, if it's opening in Full Screen mode, how is it centred or not centred? Surely that is something that's relevant only in restored mode?
Oct 7 '11 #10
ADezii
8,834 Recognized Expert Expert
@NeoPa:
Post #11 says it all from what I can see. It is not a matter of the Form itself being 'Centered' since this makes little sense in its 'Maximized' State. It appears to be a problem of centering the 'Controls' within this Form for various Screen Resolutions. A Command Button on a Maximized Form that is Centered on the Screen, will no longer be once the Resolution is changed. Technically the Controls on the Form need to be Scaled as well as Repositioned which can be done, but will be a little complex.

@JAGster: Is this correct?
Oct 7 '11 #11
NeoPa
32,557 Recognized Expert Moderator MVP
ADezii:
Post #11 says it all from what I can see.
Post #11 is the one you just posted ADezii :-S

I couldn't find any post that even seemed to indicate that, but if that's true, we have a much clearer question to answer. We'd need details of these controls of course and how they fit on the form generally. With that the situation is certainly handlable. I'm sure either of us could help with that.
Oct 7 '11 #12
ADezii
8,834 Recognized Expert Expert
@NeoPa: Make that Post #8! (LOL)
Oct 7 '11 #13
JAGster
26 New Member
ADezii, You are correct, I misstated what I really needed to know how to do. Scaling and repositioning the controls for any resolution is what I need to do.

The controls are command buttons that are opening sub-switchboards. The sub-switchboard forms have command buttons to return to the main switchboard, close and exit the database, import files to populate tables, open split-forms with subforms, etc. I've attached a copy of the database with sensitive data removed.

I am in the process of changing the look and feel of the sub-switchboard forms and the other forms to be more like the main switchboard. My end goal is to either have all forms open full-screen with the controls scaled and repositioned or to have just the main switchboard and sub-switchboards open full screen with the controls scaled and repositioned and the other forms open centered on screen no matter the resolution (if they can open in front of the sub-switchboard form that is open full screen). I want the access window always hidden no matter what form(s) are open.
Attached Files
File Type: zip Inventory Part Validation - Sample.zip (74.7 KB, 234 views)
Oct 8 '11 #14
ADezii
8,834 Recognized Expert Expert
Unfortunately, I can only use Access 2002 at this time. Kindly Convert a Copy of the DB (Forms only) to Access 2002, so that I can have a really good look at the Forms and Controls contained within.
Oct 8 '11 #15
NeoPa
32,557 Recognized Expert Moderator MVP
I just found out that maximised form windows keep the same values for height and width as when in restored view. I'm just seeing if I can find out how to determine the actual values for the form window. I know it will involve a Windows API call, I just don't know which yet ;-)
Oct 8 '11 #16
NeoPa
32,557 Recognized Expert Moderator MVP
It seems like you will need some code in your Form_Open() event I would suggest. It needs to determine the size of the form and its sections. The form object (Switchboard) has a Width property but only the sections have Height properties. This is worth remembering even though we won't be using these values due to their being unfit for purpose (See post #16). They remind us of the structure though. If you have multiple sections you will need to handle this in your logic. How you move things around within that, and what logic you use, is up to you (and we can't really comment as you haven't shared that with us), but you will almost certainly want to cycle through your controls to process each one. Here is a stub of code you can work with (I assume just a Detail section) :

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private Declare Function GetWindowRect Lib "user32" _
  5.                              (ByVal hWnd As Long, recWnd As Rect) As Long
  6. Private Type Rect
  7.     Left As Long
  8.     Top As Long
  9.     Right As Long
  10.     Bottom As Long
  11. End Type
  12.  
  13. Private Sub Form_Open()
  14.     Dim lngWidth As Long, lngHeight As Long
  15.     Dim recForm As Rect
  16.     Dim ctl As Control
  17.  
  18.     Call GetWindowRect(Me.hWnd, recForm)
  19.     With recForm
  20.         lngWidth = .Right - .Left
  21.         lngHeight = .Bottom - .Top
  22.     End With
  23.     For Each ctl In Me.Detail.Controls
  24.         '...  Your logic
  25.     Next ctl
  26. End Sub
Oct 8 '11 #17
JAGster
26 New Member
NeoPa, All functioning controls (the Quarterly Audit button has no logic/function currently assigned to it) have an On Click event that calls a macro. All macros were included in the attached macro. Except for the macro triggered by the Exit "button" all other macros close the main switchboard and open another form. The macro for the Exit button saves and closes the database.

ADezii, I have attached a 2002 version of the sample database.
Attached Files
File Type: zip Inventory Part Validation - Sample 2002.zip (62.6 KB, 187 views)
Oct 10 '11 #18
Rabbit
12,516 Recognized Expert Moderator MVP
Use a subform as a container and then center the subform in the form's on load event.
Oct 10 '11 #19
JAGster
26 New Member
Rabbit, What settings/code is needed for the subform to be centered on the form no matter the screen resolution?

As a brief recap of what I'm trying to accomplish - I want to open a switchboard to full screen size, not maximized in the Access window, but full screen so none of the access toolbars, buttons, etc are visible. And have the controls on the switchboard centered no matter what computer/monitor or monitor resolution on which the database is running.
Oct 10 '11 #20
ADezii
8,834 Recognized Expert Expert
@JAGster:
  1. To perfect Scaling, you must know specific information regarding the Screen Resolution that is active at the time you created the Form and its Controls. This info is used to create specific Ratios for Scaling all Objects. The info needed is:
    1. Horizontal Screen Resolution in Pixels
    2. Vertical Screen Resolution in Pixels
    3. Logical Dots/Inch X
    4. Logical Dots/Inch Y
  2. Download the Attachment that I have provided for you and Open frmScreenInfo. All the information that you need for proper Scaling is generated within. Copy the Call to the SetDesignCoords() Method generated at the bottom of the Screen, it will look something like this:
    Expand|Select|Wrap|Line Numbers
    1. Call frmResize.SetDesignCoords(1152, 830, 96, 96)
  3. Paste this Method Call and overwrite the comparable Line in the Load() Event of frmCentered (Line #9).
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Form_Open(Cancel As Integer)
    2. 'Instantiate the Class to handle all resizing.
    3. Set mfr = New FormResize
    4.  
    5. 'Tell the new Object what form you want it to work with.
    6. Set mfr.Form = Me
    7.  
    8. 'For 1152 x 864 Screen Resolution at the Kimmel Center
    9. Call mfr.SetDesignCoords(1152, 830, 96, 96)
    10.  
    11. 'Set certain Properties
    12. With mfr
    13.   .ScaleForm = False
    14.   .ScaleColumns = True
    15.   .ScaleFonts = True
    16.   .ScaleControls = scYes
    17. End With
    18. End Sub
  4. Open Demo.mdb in any Screen Resolution. You should find that the Form covers the entire Screen and Scales all Controls/Fonts/Columns accordingly in any Screen Resolution, making it truly independent.
  5. If this actually works, I'll tell you what to do to incorporate this into your Database.
Attached Files
File Type: zip Centered.zip (330.1 KB, 326 views)
Oct 10 '11 #21
JAGster
26 New Member
ADezii,

After pasting the resolution information from the frmScreenInfo Call frmResize.SetDesignCoords(1280, 772, 96, 96)

I got compile error "variable not defined" and showing frmResize highlighted, when I tried to open the frmCentered.
Oct 10 '11 #22
ADezii
8,834 Recognized Expert Expert
Try Call mfr.SetDesignCoords(1280, 772, 96, 96) first,

then

Paste mfr.SetDesignCoords(1280, 772, 96, 96) over the corresponding Line in the Open() Event of frmCentered in the Demo Database, not yours. Test the Demo at various Resolutions. If this works, then we can migrate to your DB. If you are still having trouble, I can modify the Demo at this end, then Upload the Revision to you for testing.
Oct 10 '11 #23
JAGster
26 New Member
It appears to be working. One questions regarding scaling. One monitor I am using is set at resolution 1280x772 (the display settings say 1280x800). The other one 1024x768. When I opened frmCenter on the second one the layout looks exactly the same as on the first one, but the picture of the globe is taller and narrower. Is this because of the scaling from the first resolution to the other?
Oct 10 '11 #24
ADezii
8,834 Recognized Expert Expert
Is this because of the scaling from the first resolution to the other?
I would image so.

Don't forget that mfr.SetDesignCoords(1280, 772, 96, 96) must correspond to the Screen Data where the Form was created.

Test at various Resolutions, and try substituting the reported resolution instead of the actual ==> mfr.SetDesignCoords(1280, 800, 96, 96)
Oct 10 '11 #25
JAGster
26 New Member
I've tested on a number of different resolutions and it does work on all of them. So, I'm now ready migrate it to my database.
Oct 14 '11 #26
ADezii
8,834 Recognized Expert Expert
  1. The vast majority of the Code is encapsulated within 3 Class Modules, Import them into your DB from the Demo. The Class Modules are: ControlResize, FormResize, and SectionResize.
  2. In the Declarations Section of your Form's Code Module, place the following Declaration which will Declare a variable to represent a New Instance of the Class.
    Expand|Select|Wrap|Line Numbers
    1. Private mfr As FormResize
  3. In the Open() Event of the Form, Copy-N-paste the Code in the Demo's Form Open() Event to your Form:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Form_Open(Cancel As Integer)
    2. 'Instantiate the Class to handle all resizing.
    3. Set mfr = New FormResize
    4.  
    5. 'Tell the new Object what form you want it to work with.
    6. Set mfr.Form = Me
    7.  
    8. 'For JAGster's Screen, Form Developement, Resolution 
    9. Call mfr.SetDesignCoords(1280, 772, 96, 96)
    10.  
    11. 'Set certain Properties
    12. With mfr
    13.   .ScaleForm = False
    14.   .ScaleColumns = True
    15.   .ScaleFonts = True
    16.   .ScaleControls = scYes
    17. End With
    18. End Sub
Oct 14 '11 #27
JAGster
26 New Member
It works!

ADezii, Thanks for all the help! Very much appreciated.
Oct 14 '11 #28
ADezii
8,834 Recognized Expert Expert
Glad it all worked out for you.
Oct 15 '11 #29

Sign in to post your reply or Sign up for a free account.

Similar topics

27
45488
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
2
6255
by: Wayne | last post by:
I've been having a click around Access 2007 this afternoon and have discovered some things that range from annoying to alarming. My Access 2003 menu bars, which I, like many others, use...
4
5447
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
16
11037
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
5
31352
by: Rocky | last post by:
My Access 2007 file fails to open on a machine with the 2007 Access runtime version installed. It comes up with a Security alert message. Is there a security setting in the Access Database that...
7
10018
by: martin DH | last post by:
A user of a database received this error when attempting to open the database on a new computer. The Access database was built in Access 2003 and is being opened in Access 2007. The database is set...
0
1782
by: newwin | last post by:
How i create a popup menu on switchboard form, like on switchboard form, when user clicks the button a popup menu is displayed then user can selects one of them using access 2007. Please tell me, the...
9
4474
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
1
4692
by: ARC | last post by:
I think I made a major blunder, and now Access 2007 no longer opens. I made the mistake yesterday of using the "test" option in wise installer for my Access 2007 runtime app. It actually installed...
7
3346
by: Robert S. | last post by:
Searching some time now for documents on this but still did not find anything about it: Is it possible to replace the entry screen of MS Office Access 2007 - that one presenting that default...
0
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7380
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.