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

How to resize a form?

100+
P: 283
This is probably really easy but i have been playing around with this and reading up on how to resize a form and its not working the way i want it to.

I have a main form and when you click on a button I have another form that pops open. Now if i have my main form maximized to full screen and then have the second form pop open it will also maximize.

How do i set the second form to open at a preset size and not get any bigger or smaller. I tried using this in the On Open function.

Expand|Select|Wrap|Line Numbers
  1. With Me
  2. .InsideHeight = 5150
  3. .InsideWidth = 7250
  4. End With
  5.  
Which works great but if I have the main form open to full size the second form does not resize.

Appreciate the help
Apr 17 '10 #1
Share this Question
Share on Google+
8 Replies


ADezii
Expert 5K+
P: 8,597
@slenish
The easiest, codeless, way is to set the Border Style of the 2nd Form to Thin. This Form (2nd Form) will now have a thin Border and can include any of the Border elements. The Form isn't Resizable (the Size command on the Control menu isn't available). You often use this setting for Pop-Up Forms.
Apr 18 '10 #2

mseo
100+
P: 181
hi
if you want to use a code for resizing a form you can use this for modifing the height, width, Right, Down just assign a value for each to get the suitable view
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     DoCmd.MoveSize Height:=5000
  3.     DoCmd.MoveSize Width:=1000
  4.     DoCmd.MoveSize Right:=500
  5.     DoCmd.MoveSize down:=500
  6. End Sub
hope this helps
Apr 19 '10 #3

100+
P: 283
ADezii,

Do you think that its possible to make it in to a pop up box type of format that way i can play with the sizes? I have it set to pop open now if you wish to add something to a list. Maybe I could change that to a pop up type of box instead? Not really sure how to do it right now but i will look in to it in more detail.

Mseo,

Thanks for the code on resizing it only works if the main form is not maximized then it will hold the set width and height. But if i maximize the main form and open the second form it is also maxed.

I'll keep playing with it and see if i can figure anything out.

thanks again :)
Apr 19 '10 #4

100+
P: 283
I just got it to work!

I used the combination of what both for you said and now it works perfectly. I reset the form to a pop-up and then on open set the size of the form. I can now maximize the form and open the pop-up with no problems.

Really appreciate the help.

also I found this link that helped as well.
http://office.microsoft.com/en-us/ac...884371033.aspx
Apr 19 '10 #5

NeoPa
Expert Mod 15k+
P: 31,186
It seems that Pop-Up forms may be the exception to how windows work in Access (& Office apps generally it seems), which is that maximising a form actually sets the maximisation globally across all windows within the application. Pop-Up forms are not constrained to this behaviour it would seem.
Apr 20 '10 #6

NeoPa
Expert Mod 15k+
P: 31,186
Interesting link by the way. Did you catch the Note at the bottom where it explains you can open it as a Pop-Up, even if not designed that way, with a parameter in the call?
Apr 20 '10 #7

100+
P: 283
@NeoPa
I did not see that at the bottom. I will have to play around with that and see if that works better.Is there a setting for changing it to a Dialog box?

So far using it as a pop up box works great. Still seems to function like a form just opens like a pop up when I need it to. Also editing it is a little different but not much.
Apr 20 '10 #8

NeoPa
Expert Mod 15k+
P: 31,186
That really depends on what you mean exactly. I suggest you check out the form properties Pop Up, Modal & Border Style. Select each in turn and press F1 for Context-Sensitive Help. Read through what they all say and see if they can be used to suit your purpose.

When you've done that, you can look at the parameters for DoCmd.Openform() (also available through F1), in particular WindowMode and the value acDialog, and decide how you want to play it from there.
Apr 21 '10 #9

Post your reply

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