473,385 Members | 1,587 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,385 software developers and data experts.

Resize Parent Form on The Fly

I am building a wizard and have an issue with one sub form. Whilst all others are about 5 fields tall this one is 15 fields.

My choices are either to resize the parent form ridiculously large for the other forms or resize the parent form on loading this subform.

I have tried the following:

Expand|Select|Wrap|Line Numbers
  1.  Me.Parent.Form.Section(acDetail).Height = 1.4 * Me.Parent.Form.Section(acDetail).Height
  2.  
  3.     'Me.Parent.Form.Section(acDetail).Repaint
  4.  
  5.     Me.Parent.Form.Repaint
This is in the Form load event of the subform, but doesn't work. I have been trying various iterations of this and can't get it to work.

Anyone got some code that works?
Feb 25 '08 #1
2 3006
Zwoker
66
Hi,

For what its worth I have some code that resizes the whole form when I need it. The code resides in my Form_Activate event. I run MS Access 2003. Maybe it will be of some help?

Expand|Select|Wrap|Line Numbers
  1. Const conInchesToTwips = 1440
  2.  
  3. Me.Move Left:=Me.WindowLeft, Top:=Me.WindowTop, Width:=3.8 * conInchesToTwips, Height:=5.9 * conInchesToTwips
I seem to recall there are some rules for using the Move method. Such as it not being allowed on Modal forms? Help for the command in your version of MS Access should give you the answers, if the method is of any use to you.


Regards,
Zwoker.
Feb 25 '08 #2
ADezii
8,834 Expert 8TB
I am building a wizard and have an issue with one sub form. Whilst all others are about 5 fields tall this one is 15 fields.

My choices are either to resize the parent form ridiculously large for the other forms or resize the parent form on loading this subform.

I have tried the following:

Expand|Select|Wrap|Line Numbers
  1.  Me.Parent.Form.Section(acDetail).Height = 1.4 * Me.Parent.Form.Section(acDetail).Height
  2.  
  3.     'Me.Parent.Form.Section(acDetail).Repaint
  4.  
  5.     Me.Parent.Form.Repaint
This is in the Form load event of the subform, but doesn't work. I have been trying various iterations of this and can't get it to work.

Anyone got some code that works?
I hate to be the bearer of bad news but your code will never work, since Form Section Properties can only be modified in Form Design View. What you essentially need to do is to Close the Main Form, Open it in Design View, change the Detail Section dimensions, and the Open it again as in:
Expand|Select|Wrap|Line Numbers
  1. 'Assuming your Main Form is frmMain, and you are executing this code from an Event within the Sub-Form:
  2. DoCmd.Close acForm, "frmMain"
  3. DoCmd.OpenForm "frmMain", acDesign
  4.   'Make changes while in Form Design View
  5.   Application.Echo False
  6.     Me.Parent.Form.Section(acDetail).Height = 1.4 * Me.Parent.Form.Section(acDetail).Height
  7.   Application.Echo True
  8. DoCmd.OpenForm "frmMain", acNormal, , , acFormEdit
Feb 26 '08 #3

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

Similar topics

5
by: Ian Stiles | last post by:
I have tried everything under the sun to get rid of horrible flashing and flickering that occurs on a CSharp form when the form hosts a TreeView or WebBrowser control and then you resize the form....
8
by: Ian Stiles | last post by:
If you have "Show window contents while dragging" turned on (Right-click desktop, Appearance, Effects) then you get horrible flashing and flickering on a CSharp form when the form hosts a...
0
by: Bisbal | last post by:
Hi All, I have created a class that simulates a MDI form by putting the 'child' inside a panel located in the 'parent' form. I had to do this because we use a custom UI that doesn't work...
3
by: Z D | last post by:
Hello, BACKGROUND: ============== I've created a Windows User Control that contains an Image Control (among other controls). The user control handles the picture resize event. Whenever the...
6
by: Ty Salistean | last post by:
I have a form that I inherited from System.Windows.Forms. I use that form everywhere in my system. I went back to my base class form and changed the size, expecting all of my children forms to...
0
by: Patrick Lioi | last post by:
We have form that is used as the base class of all of our forms, let's call it BaseApplicationForm. We have another form, say ChildApplicationForm that inherits from BaseApplicationForm. The...
1
by: Rich | last post by:
Hello, I have a child form in a parent MDI form. The childform is being shrunk and cannot be resized when screen resolution is 800x600. The end user who uses my app cannot see stuff on the...
4
by: michael sorens | last post by:
In a Windows Form application, when a user resizes the window, I typically want different components in the form to take different actions. For example, a text box in the middle should grow...
5
by: =?Utf-8?B?UmljaA==?= | last post by:
Hello, If I create a form in Java with controls like Panels, textboxes... when I stretch/shrink the form, all the controls can grow/shrink - along with the text contained in the textboxes. This...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...

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.