By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

Forms resizing

100+
P: 553
I have 2 forms. Form1 and Form2

With a button click on form1 , i can open Form2.

How can i send a message to Form2 so that it open with size i provide from Form1 - I dont want to put the code in Form2 because i may need to open Form2 from different forms and all the times, the sizes would be different
Jul 20 '07 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,597
I have 2 forms. Form1 and Form2

With a button click on form1 , i can open Form2.

How can i send a message to Form2 so that it open with size i provide from Form1 - I dont want to put the code in Form2 because i may need to open Form2 from different forms and all the times, the sizes would be different
How exactly are you providing the sizes for Form2 within Form1?
Jul 20 '07 #2

100+
P: 553
For example, if i open a form:

Call DoCmd.OpenForm("frm_sub_search_client", acNormal, , , , acWindowNormal)

i want to resize it ... i can provide any size (width, hieght, etc)

i dont know the methods or properties to use to implement it





How exactly are you providing the sizes for Form2 within Form1?
Jul 20 '07 #3

ADezii
Expert 5K+
P: 8,597
For example, if i open a form:

Call DoCmd.OpenForm("frm_sub_search_client", acNormal, , , , acWindowNormal)

i want to resize it ... i can provide any size (width, hieght, etc)

i dont know the methods or properties to use to implement it
My favorite Method of resizing a Form is to use the Move Method because you can set the Left, Top, Width, and Height dimensions all within a single command. Rather that provide an explanation, I feel it would be better for you to just view the code. The code will:
  1. Move Form1 - 1 inch from the Left side of the Access Window.
  2. Move Form1 - 1 inch from the Top side of the Access Window.
  3. Adjust the Width of Form1 to 8 inches.
  4. Adjust the Height of Form1 to 5.5 inches.
Expand|Select|Wrap|Line Numbers
  1. Dim frm As Form
  2. Set frm = Forms!Form1
  3.  
  4. 'all measurements are in Twips where 1 inch = 1440 Twips
  5. Const conInchesToTwips = 1440       'easiers to enter measurements in Inches
  6.  
  7. If frm.Moveable Then
  8.   frm.Move Left:=1 * conInchesToTwips, Top:=1 * conInchesToTwips, Width:=8 * conInchesToTwips, _
  9.            Height:=5.5 * conInchesToTwips
  10. Else
  11.   MsgBox "The form cannot be moved."
  12. End If
Jul 20 '07 #4

Post your reply

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