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

Form Refuses To Maximize

P: 25
Hi Everyone!
I have a form that opens from a another form set as a dialog box via a command button. I have tried about everything I can think of to make this form maximize when it opens.
I've used the
dcmd.maximize
in the "on open" and "on load" event procedures of the form. Also tried using it in the code of the command button that opens the form. Nothing seems to force this pesky thing to maximize.
What am I doing wrong?
Here's the code from the command button that calls the form:
Expand|Select|Wrap|Line Numbers
  1. Dim WClause
  2.     WClause = "[Date] Between #" & _
  3.     Me![Start] & "# and #" & _
  4.     Me![End] & "# and [Entered By] = '" & [Combo0] & "'"
  5.     DoCmd.OpenForm FormName:="NameFindForm", _
  6.     whereCondition:=WClause    
  7.  
  8.     DoCmd.RunMacro "Close Dialog1 form"
Is there a property setting on the form itself that might keep it from maximizing?
Thanks for any help!
Jan 6 '07 #1
Share this Question
Share on Google+
13 Replies


nico5038
Expert 2.5K+
P: 3,072
I use always in the OnActivate event of the form the docmd.maximize command and that's working for me.

Nic;o)
Jan 6 '07 #2

missinglinq
Expert 2.5K+
P: 3,532
Other than not opening maximized, is the form behaving as intended?
Jan 6 '07 #3

ADezii
Expert 5K+
P: 8,669
Hi Everyone!
I have a form that opens from a another form set as a dialog box via a command button. I have tried about everything I can think of to make this form maximize when it opens.
I've used the
dcmd.maximize
in the "on open" and "on load" event procedures of the form. Also tried using it in the code of the command button that opens the form. Nothing seems to force this pesky thing to maximize.
What am I doing wrong?
Here's the code from the command button that calls the form:
Expand|Select|Wrap|Line Numbers
  1. Dim WClause
  2.     WClause = "[Date] Between #" & _
  3.     Me![Start] & "# and #" & _
  4.     Me![End] & "# and [Entered By] = '" & [Combo0] & "'"
  5.     DoCmd.OpenForm FormName:="NameFindForm", _
  6.     whereCondition:=WClause    
  7.  
  8.     DoCmd.RunMacro "Close Dialog1 form"
Is there a property setting on the form itself that might keep it from maximizing?
Thanks for any help!
You stated that you could not Maximize your Form in the OnOpen and OnLoad Events using dcmd.maximize. The correct syntax is:
DoCmd.Maximize and it will work in a Form's Open() Event.
Jan 6 '07 #4

missinglinq
Expert 2.5K+
P: 3,532
I assumed that was a typo in the posting, as it would raise a syntax error if it appeared that way actual code. I've tried to reproduce the problem using a variety of forms and a variety of settings and combinations thereof and cannot do so. The usual problem we hear is just the opposite: once one form is maximized they all want to be big! I went trolling on some other sites and one suggestion I saw was placing the code in the form's Activate Event. Probably worth a try, and only take a few seconds.

To be honest, my first thought when simple things start acting strange, odd or curious is corruption. I'd try the old routine of:

Make a blank db
Import everything from the old db into the new one
Delete the old one and rename the new one
Jan 6 '07 #5

Expert 5K+
P: 8,434
I find myself wondering whether it's possible this could be due to some setting or combination of them in...
  • Border type
  • Pop up
  • Auto Resize
  • Auto center
Jan 6 '07 #6

nico5038
Expert 2.5K+
P: 3,072
I have bad experiences with "Modal" "Popup" forms, as they tend to not trigger some events when being closed.
I stopped using these properties different as their initail setting.

When a "default" form doesn't react I would tend to think that your Office installation got corrupted and it might help to reinstall Office.

Nic;o)
Jan 6 '07 #7

missinglinq
Expert 2.5K+
P: 3,532
It being a slow evening here in Lake Woebegone, I took your suggestion and have run thru permutaions of the properties you mentioed as well as Allow Design Changes and even whether the Min/Max button was set, all without any joy. Of course, after running them all, I had to give myself a dope slap; forgot that I had to exit Access completely between each attempt, otherwise, as I myself mentioned earlier, once a form is maximized every form opened thereafter will be maximized, even if it's the same form and the code to maximize has been removed! Ran all the permutations again, closing between each attempt, still without any joy!

Can't help but notice that while we've been trying to find a solution the original poster hasn't responded to any of our comments, suggestions or requests for information. I'm going to hang it up for the evening and go have a pint. Perhaps I'll find some inspiration there!
Jan 7 '07 #8

NeoPa
Expert Mod 15k+
P: 31,602
Hi Everyone!
I have a form that opens from a another form set as a dialog box via a command button. I have tried about everything I can think of to make this form maximize when it opens.
I've used the
dcmd.maximize
in the "on open" and "on load" event procedures of the form. Also tried using it in the code of the command button that opens the form. Nothing seems to force this pesky thing to maximize.
What am I doing wrong?
Here's the code from the command button that calls the form:
Expand|Select|Wrap|Line Numbers
  1. Dim WClause
  2.     WClause = "[Date] Between #" & _
  3.     Me![Start] & "# and #" & _
  4.     Me![End] & "# and [Entered By] = '" & [Combo0] & "'"
  5.     DoCmd.OpenForm FormName:="NameFindForm", _
  6.     whereCondition:=WClause    
  7.  
  8.     DoCmd.RunMacro "Close Dialog1 form"
Is there a property setting on the form itself that might keep it from maximizing?
Thanks for any help!
The form is set as a Dialog Box?
Pop Up & Modal properties set to Yes?
In that case I don't believe Maximizing is supported for that type of form at all.
Jan 7 '07 #9

Expert 5K+
P: 8,434
The form is set as a Dialog Box?
Pop Up & Modal properties set to Yes?
In that case I don't believe Maximizing is supported for that type of form at all.
Does that mean I was right? :)
Jan 8 '07 #10

NeoPa
Expert Mod 15k+
P: 31,602
Both you and Nico were looking along the right lines.
That's assuming I'm right - I haven't done exhaustive testing.
Jan 8 '07 #11

Expert 5K+
P: 8,434
Both you and Nico were looking along the right lines.
That's assuming I'm right - I haven't done exhaustive testing.
Surely two experts and a senior member can't be wrong! ;)
Jan 8 '07 #12

P: 25
Hi Guys.,
First let me apoligize for my absence. Was busy over the weekend and couldn't get back here. Sorry!

I put the DoCmd.Maximize code in the OnActivate event of the form as was suggeted and that fixed it. I have no idea why it wouldn't work in the other events.
Yes the form always worked as needed and returned the desired results just would not maximize. I have this code in other forms in my file in the OnOpen and OnLoad events and they work.

Anyway, Thanks Millions guys for your help and sorry I didn't respond sooner.
Jan 8 '07 #13

NeoPa
Expert Mod 15k+
P: 31,602
We're just pleased you were helped.
It is not necessary to be on here all the time - we understand other people have lives and a forum site rarely works on immediate responses.
It's nice that you did come back to let us know it's been fixed though.
TY -Adrian.
Jan 8 '07 #14

Post your reply

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