Cannot set the size of a form

G

Guest

I have a form Form1. Clicking on one of the textbox on this form opens up
another form, Form2. In the properties for Form2 I have set height / width as
required. When Form1 is at its default size (not maximized) Form2 opens up in
the size I want. However when Form1 is maximized Form2 also opens up
maximized. I want Form2 to open up with the dimensions that I have set. (I
have set Auto Resize property to No).
 
M

MacDermott

You might try setting Form2's PopUp property to True.
Note that this will keep Form2 always on top of Form1.
 
G

Guest

Following your instructions caused Form2 to stop displaying values in the
textboxes. I want Form1 to be displayed as maximum and while keeping Form2
size to the dimensions I set. I tried using DoCmd.Restore but this restores
all active forms including Form1.
 
M

MacDermott

Let's keep our issues separate here.
DoCmd.Maximize will maximize all forms.
DoCmd.Restore will restore all forms.
(Note that neither gives you any option of specifying which form it is
applied to.)
Setting a form's Popup property to True (in the property sheet), keeps it
from maximizing.
This also causes that form to stay on top of any forms which were open
when it was opened.
This is the problem you originally posted.
Is the problem of Form2 resizing resolved now?

Now, you claim that if Form2 is set to Popup=True, it no longer displays
values in the textboxes.
Are the textboxes on Form2?
Where do they (should they) get their values? (What are their
ControlSources?)
 
G

Guest

The problem persists. Let me repeat my request. Form2 opens as a result of
clicking on one of the textboxes on Form1. Form2 has number of textboxes the
values for which come from a query. I want Form2 to be dispalyed in the size
that I want (whether or not Form1 is maximized).

Thanks.
 
M

MacDermott

Are you saying that when you set the Popup property of Form2 to True in
design view, it is not displayed in its "normal" size, regardless of the
windowstate of Form1?
 
G

Guest

Setting PopUp property for Form2 to True displays it in the size that I want
but as I have mentioned before the textboxes in Form2 then contain no values.
These values come from a query.
 
M

MacDermott

All right, then -
we can stop focussing on the size problem, and look at why the query is
returning no values.
Could you post the SQL for the query?
 
G

Guest

Thanks for your help. I figured out the problem with the query and everything
works well now. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top