I'm using docmd.openform frmname to make the form visible (i.e normally the
form visible property is false so to make sure the form opens I use
docmd.openform on the slight off chance that it has been closed (in many
cases during testing I just open the form from the database form table so
when it closes it automatically Access opens the form that opened it the
last time)
Hi Jason,
perhaps the problem is that the form is activating in code but does not
have the focus -- maybe by the time the form shows, whatever is being
displayed has altered the WindowState setting
try this:
'~~~~~~~~~~~~~
'... code...
'DoCmd.OpenForm ...
'after you open the other form, give it the focus
DoCmd.SelectObject acform, "Formname"
'also try this here...
DoCmd.Restore
'close the form you are behind, don't save
DoCmd.Close acform, me.name, acSaveNo
'~~~~~~~~~~~~~
WHERE
acSaveNo is optional and means to close without saving changes to form
properties; data is saved automatically.
~~
if that doesn't work, something else to consider if code in the Close
event doesn't work, here is what Help says about the form Deactivate
event:
"The Deactivate event occurs when the form or report loses the focus to
a Table, Query, Form, Report, Macro, or Module window, or to the
Database window."
... doesn't say if 'when' is before or after though...
~~
Warm Regards,
Crystal
Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace
*
have an awesome day
*
Jason wrote:
Sorry - typo. I click the ... at the end of event procedure to get here.
The
preceding form (that's closing) could be called from different forms so
it
might be possible that anther from could stil lbe required to be
maximised.
Hi Jason,
Activate:
I wondered if that is what you meant by Active... should have specified
that you got the event name wrong (which is important because that is
how the procedure is labeled)
is [Event Procedure] IN the Activate property? sometimes you have code
behind the form but it is not linked up... best to check
Do you have any other screen resizing commands behind the form?
Do you switch to this form and THEN close the other one? If so, then,
yes, you should put it in the CLOSE event of the other form
Warm Regards,
Crystal
Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace
*
have an awesome day
*
Jason wrote:
Please read my post. It is already in there.
Hi Jason,
try putting docmd.restore in the form Activate [Event Procedure]
Warm Regards,
Crystal
Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace
*
have an awesome day
*
Jason wrote:
If I go from this form to a maximized form then when I go back to
this
form
it is maximized. I have docmd.restore in the on Active and GotFocus.
A
work
around is to use docmd.restore in the close command of the previous
form. Is
there another way?
Thanks,
J.