Form border can't be None

B

BruceM

I have a command button on a main form to open a form (frmParam), which is
used for selecting report parameters. I set the border for frmParam to
None, then opened it by way of the Click event of a command button on the
main form:
DoCmd.OpenForm "frmParam", , , , , acDialog
My understanding of acDialog is that it sets the Pop-up and Modal properties
of the form to Yes. However, when I open the form in this way it ignores
that the border is None, and I get the application title bar (or whatever
exactly the top bar is called). However, if I set the Pop-up and Modal
properties of frmParam to Yes, and open it with:
DoCmd.OpenForm "frmParam"
the border is gone, as it should be, since I set it to None in the form's
property sheet.
This is a minor annoyance, but puzzling. What's the story here?
 
G

Graham R Seach

Bruce,

Make sure the form isn't displaying anything that requires a titlebar
(ControlBox, MinMaxButtons or CloseButton).

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
M

missinglinq via AccessMonster.com

Not to be mean, but the story is that your understanding of acDialog is
incorrect! acDialog means that the form *has* the application title bar and
the form cannot be resized. It doesn't mean that the form is either popup or
modal; these have to be set independantly. Anytime you use DoCmd.OpenForm to
open a form, that form is opened and any arguments used, such as *acDialog*
overrides the form's own properties. When you simply used DoCmd.OpenForm
"frmParam" to open the form, you added no arguments, and so the form opened
as you originally designed it.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
B

BruceM

From OpenForm Help:
"You set the Modal and PopUp properties when you design the form. If you
use Normal for the Window Mode argument, the form opens in the mode
specified by these property settings. If you use Dialog for the Window Mode
argument, these properties are both set to Yes."
It is apparently true that Dialog mode overrides my choice of "None" for the
form's border style, but Help gives no indication of this.
 
M

missinglinq via AccessMonster.com

What, Access *Help* isn't helpful? There's a newsflash for you! Sad to say,
this is often true! I suspect it has to do with the junior-most member of the
development team being assigned this rather mundane task. Micro$oft's poor
track record in this and in documentation almost derailed my programming
career before it got started! Back in the pre-Windows days of DOS, when I got
my first PC, I got so frustrated I almost returned it to the seller! Luckily
someone directed me to a good third-party textbook!

Glad you got it sorted out, anyway!

Good luck with your project!

Linq

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
B

BruceM

Thanks for the reply. Nothing in the form requires a title bar, as far as I
can tell. It seems that acDialog does not produce the results I expected
based on the OpenForm Help. Once I set the form's properties to Pop-up and
Modal it behaved as I wanted.
 

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