Can not get form to display Docmd.restore

J

Jason

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.
 
J

Jason

Please read my post. It is already in there.
strive4peace said:
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 :)
*



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.
 
S

strive4peace

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 :)
*



Please read my post. It is already in there.
strive4peace said:
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 :)
*



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.
 
J

Jason

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.
strive4peace said:
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 :)
*



Please read my post. It is already in there.
strive4peace said:
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.
 
S

strive4peace

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 :)
*



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.
strive4peace said:
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 :)
*



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.
 
J

Jason

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)
strive4peace said:
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 :)
*



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.
strive4peace said:
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.
 
J

Jason

I've created a table and function so when the form closes it checks what the
calling form should be then runs docm.restore if appropriate.
Jason said:
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)
strive4peace said:
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 :)
*
here.
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.
 
S

strive4peace

Hi Jason,

are you still looking for an answer or did you get this figured out?

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*



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)
strive4peace said:
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 :)
*



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.
 
J

Jason

No - just added the docmd.restore and docmd.maximise after docmd.open
strive4peace said:
Hi Jason,

are you still looking for an answer or did you get this figured out?

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*



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)
strive4peace said:
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.
 
S

strive4peace

Hi Jason,

glad you got it figured out

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*



No - just added the docmd.restore and docmd.maximise after docmd.open
strive4peace said:
Hi Jason,

are you still looking for an answer or did you get this figured out?

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*



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.
 

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