Problem building custom switchboard

A

Al Williams

Access 2003/XP:
I'm building a switchboard using a form that opens either of two other
forms. The two other forms are used to open labels or reports. All
forms are sized exactly the same height and width. When the main form
opens either of the other two, they display slightly offset from the
main. I want them to overlay each other exactly because it is annoying
to see the "jump" in position.

I tried setting the mode of the two forms mode to popup but the labels
and reports stay "under" the popup form which I don't want because it
interferes with the users ability to see the labels or reports.

How do I force the opened forms to stay centered, not "jump", and allow
the labels and reports to be viewable? Autosize and autocenter are
turned on.

Thanks.
 
A

Albert D.Kallal

The trick here is to set the autosize to no.

And, set the autocenter to yes.

Now, size your forms as you want, and save them. In fact, once you got them
sized, change the boarder style from sizeable to thin.

Note that you can do the sizing in view mode, and go ctrl-s to save the
form. After you get this the way you want, then set the forms sizable
boarder to thin.

also, each additional form should be model (NOT NOT popup).
 
A

Al Williams

Albert,

Thank you for responding.

Per your instructions, I set the called forms to modal with
autocenter/yes and autoresize/no. I also set the main form to modal/no,
popup/no, autocenter/yes and autoresize/no. And, I've set border style
to thin on all three.

The two called forms now work as I want them to, but the main form
continues to "jump" up about 1/4 inch from its original centered
position when it is re-opened after closing either of the two called forms.

I tried to re-size the main form after turning resize off but I've
discovered I don't know how to adjust the sizing properties (I've always
used resize/on for forms - but I haven't done that many; I'm a newbie).

I see Form Header, Detail, and Form Footer. The Detail Height property
changes as I drag the size of that section by dragging Form Footer but
the overall form height doesn't. I see a Form Width property but not a
Form Height property. There is some sort of interaction between the
detail size and form size but I haven't found any information in Access
Help (2003). Can you give me some tips?

Thanks.

Al
 
A

Al Williams

Albert,

Since I'm new at virtually everything, perhaps the code that I'm using
to return to the main form would provide some insight. It was written
by the Command Button wizard.

Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click


DoCmd.Close
DoCmd.OpenForm "frmSwitchboard", acNormal, , , , acDialog

Exit_cmdExit_Click:
Exit Sub

Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click

End Sub

Again, thanks.

Al
 
A

Al Williams

Albert,

Access has so many buttons and whistles, getting on top of it is a steep
curve!

After finding the OpenForm Method help, I discovered that the last
option in the OpenForm cmd for reopening the main form should have been
acWindowNormal. Now the main form doesn't jump anymore.

And, after reading a lot of pages in Prague and Irwin's Access 2002
Bible last night, I discovered that "When you display a form with an
added header or footer, the equivalent amount of space is lost from the
Detail section. The size of your Detail section must be adjusted to
compensate for this lost space." I think that explains the "funny"
interaction between dragging the Detail section and the overall form
size. I'll have to experiment.

So, I think these problems are solved. Thank you very very much for
pointing me in the right direction and telling me some of the "buttons
to push"!

Al
 
A

Albert D.Kallal

The two called forms now work as I want them to, but the main form
continues to "jump" up about 1/4 inch from its original centered position
when it is re-opened after closing either of the two called forms.

Good progress. I would check if a menu bar/tool bar is displaying, or hiding
during this process. (the form loads, menu bar appears, or dis-appears, and
the form jumps...check for this problem, as this will mess up form position.
The solution is to hide those menus, or provide your own custom menus. This
might not be your problem...but be aware...
I tried to re-size the main form after turning resize off but I've
discovered I don't know how to adjust the sizing properties (I've always
used resize/on for forms - but I haven't done that many; I'm a newbie).

I see Form Header, Detail, and Form Footer. The Detail Height property
changes as I drag the size of that section by dragging Form Footer but the
overall form height doesn't.

yes, be careful. If you re-size the detail section, the form size will not
change, but SCROLL BARS will appear!! This lets you size a form, but use
scroll bars to see more of it. So, to size a form, you will want to use that
original method I suggested. So, set the border size to re-sizeable, size
the form while in view mode. Do remember however, if you form size is
SMALLER then what you make the detail section to, then the over all form
size will NOT increase, but you get scroll bars. So, really, you kind of
want to make sure you whole form size is slightly larger then what the
details+heading+footer is. A really good way to see this in action is to
turn on BOTH scroll bars. If you size the form to small, you will see scroll
bars. So, keep making the form larger until the scroll bars go away. OF
course, if you turned off the scroll bars, then you can see this effect.
What this means is you want to size the detail section (the main middle
part) to be as small as you can (or, at least the rule here is NO larger
then you need!. Any extra sizing of this detail section is a waste, and can
be source of confusing, and can also cause scroll bars to appear when you
actually don't need them. .

And, before you do size the form in view mode, check your form header, and
footers..and re-size them in design mode. Remember, when you increase the
size of the form beyond what the detail + footers is, the bottom footers
increases in size, not the detail section (in fact, the footer don't
increase, but that is were blank space is padded as you increase the form
size). So, again it is a good idea to size heading/footer to what size you
need in design mode, and set the detail section in design mode (to as small
as possible). Regardless, at the end of the day, you can size the form to
be MUCH larger then what the details and footers take up. (the footer will
grow if you re-size the form...not the detail section.

So, you should still flip into view mode..and re-size the form for the
OVERALL size of the form. (it is the re-sizing of the form that sets the
final size you see the screen, regardless of the size of details, or footers
etc inside. You can then go ctrl-s at this point to save (and then flip into
design mode, and change the border to thin to prevent further accidental
re-sizing).

And, if you wish, you might just leave the border style as re-sizable, as
most users don't change that anyway...

And, last but not least, be aware that you can turn off/on a forms
heading/footer, and forms page heading/footer...don't get these confused
either! (and, turn ones off that you are not using). As a general rule, you
don't need the forms page heading unless you have a form that is MUCH larger
then the screen, and you use this feature (this feature is not much used
anymore since we got tab controls).
 
A

Al Williams

Albert,

I discovered that the main form was jumping because it was being opened
with the window mode set to Dialog when the DoCmd executed. The
OpenForm Method help told me that Dialog was forcing Modal/Yes and
Popup/Yes. A note in the Modal Property help says that this disables
menus and toolbars in addition to other windows. What I observed was
the removal of one of the toolbars when the main form opened. The main
form then jumped up to remain the same distance from the bottom of the
existing toolbars as the other forms. Or, that is how I understand the
action. Changing window mode to WindowNormal eliminated the problem of
jumping.

I had never thought of changing a form's size while in View! Thank you.
I worked my way through your description of changing a form's size and
created a temporary database with a single form to explore. I turned
off autoresize and adjusted the form's height and width in View mode
while leaving the Detail section size constant - and saw the Scroll Bars
come and go as you described.

I also left the form size constant and turned on/off the form header and
form footer to see what happens in View as I changed the size of the
form footer in Design. Because it is hard to tell which area is which,
I put labels ("Form Header", "Detail Section", and "Form Footer") on the
form in their respective sections and set DividingLines to Yes. I
discovered that the footer area remains just above the navigation
buttons at the bottom of the form and the detail area "comes down" from
the top of the form - right below the form header (if there is one)- as
I changed the height of the form in View. If the form size is bigger
than the form header, detail, and form footer, the "misadjustment" shows
up between the detail area and the footer area as a blank pad area.
That doesn't quite match with my understanding of your description.
Does that mean that there is a difference in the way forms are handled
between the versions of Access? I used Access 2003/XP Pro-SP2 for this
experiment. (To understand what happens with autoresize, I then turned
autoresize back on, closed the form, reopened it, and discovered that
autoresize removes the blank pad area while leaving the form header,
detail and form footer heights constant.)

I want to thank you very much for your help! I had tried to size forms
manually when I started working with Access but quickly gave up when I
saw all the interaction and didn't understand how to drive the design.
So, I relied on autoresize to do the work for me. Knowing how to drive
the design manually is a real plus!

Again, thanks.

Al
 
A

Albert D.Kallal

If the form size is bigger
than the form header, detail, and form footer, the "misadjustment" shows
up between the detail area and the footer area as a blank pad area

Yes, the above seems right. I am also using a2003. So, we are on the same
book here!
The OpenForm Method help told me that Dialog was forcing Modal/Yes and
Popup/Yes.

It is true that a Dialog form is model, and popup.However, a model form is
NOT dialog. (it does not halt calling code, and menu bars etc can be used).
A note in the Modal Property help says that this disables menus and
toolbars in addition to other windows.

Actually, a dialog form disables menus, but NOT model form. Don't get the
two confused, as they are VERY different.

I talk about the difference here:

http://www.members.shaw.ca/AlbertKallal/Dialog/Index.html
 

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