473,396 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to stop DoCmd.Maximize in one form from maximizing all later forms

Hello,

For one form, I want it to maximize upon opening. So, in that form's "On Load" Event, I put in:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. DoCmd.Maximize
  3. End Sub
However, all subsequent forms that I open will maximize. I do not want that. I want the one form mentioned above to open maximized, and I'd like the other forms to open at their saved sizes.

For the subsequent forms, I tried putting in code in their "On Load" events, using DoCmd.MoveSize. However, even with height and width specifications, it will still open maximized IF I have opened that other form first.

In short, how can I have one form open maximized and other forms not? Thank you very much!
Mar 24 '11 #1

✓ answered by Andy Sauer

Ah, once I again I asked too soon when the answer was in another post.

For the one form, I will use Maximize:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load() 
  2. DoCmd.Maximize 
  3. End Sub
For subsequent forms, I will use Restore:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load() 
  2. DoCmd.Restore
  3. End Sub
In addition, I can add Restore to the "On Close" for the form that maximizes:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Close()
  2. DoCmd.Restore
  3. End Sub
This will prevent it from maximizing a form that was already open.

The combo of the above seems to work, unless anybody has a better solution. Thank you.

2 4199
Ah, once I again I asked too soon when the answer was in another post.

For the one form, I will use Maximize:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load() 
  2. DoCmd.Maximize 
  3. End Sub
For subsequent forms, I will use Restore:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load() 
  2. DoCmd.Restore
  3. End Sub
In addition, I can add Restore to the "On Close" for the form that maximizes:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Close()
  2. DoCmd.Restore
  3. End Sub
This will prevent it from maximizing a form that was already open.

The combo of the above seems to work, unless anybody has a better solution. Thank you.
Mar 24 '11 #2
NeoPa
32,556 Expert Mod 16PB
I guess, though you explain it in a strange way, you now realise that you cannot stop all forms being maximised and restored whenever any one of them is maximised and restored. Your solution gets around it in a workable way though. The only thing it doesn't give you is the option to have one form maximised with others in the foreground that are restored.
Mar 24 '11 #3

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

Similar topics

2
by: Scott | last post by:
I've used the DoCmd.Mazimize function on my databases main opening form and now all the forms maximize on open, not just the form the command has been placed in. (onOpen) Any ideas why or how I...
1
by: Brandon | last post by:
Hello there. I'm currently working on a moderately complex Visual C# windows application that I have run into a bit of a problem on. To start things off, the application has normally been run...
2
by: Jerome Ranch | last post by:
Okay What property of a form do I need to change so that it opens full screen? I'm calling it to open from VBA. I built a form today, and while I was playing with it (to test some of the...
5
by: Mrozu | last post by:
Hi When I maximize a form in VB.Net 2003 the bottom of the form gets hidden by the start bar (so my status bar is invisible). How can I get my app to maximize to the usable screen area above...
2
by: RajaKannan | last post by:
Hi All, I have a form in which i have few mandatory fields. Wheneve the user tries to save, i check for these fields and alert them, if thet are empty. I have a CLOSE button in my form and...
1
by: access baby | last post by:
Hi I would like to know should i create 1 form or 2 forms i have 2 deperment working on the same table but first half is taken care of by 1 dept. and the other half by other dept. eg from project...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
0
by: Rotsey | last post by:
Hi, I have a MDI form with child forms and a Window menu. When a new child form is created or closed I want to update the menu with a item for the child window. Problem is I have it adding...
1
by: gazelle04 | last post by:
I want to maximize all forms. I've entered DoCmd.Maximize on forms. The problem comes up when I return to the form from another form - It returned to Restore mode and all the other forms become...
2
by: =?Utf-8?B?S2F5xLFoYW4=?= | last post by:
i have a datagridview on my Form. When i maximize form ,datagridview remains in its initial size. i want it rearrage itself with parent form. is it possible to solve on v.studio design mode ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...

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.