A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can not get form to display Docmd.restore



 
 
Thread Tools Display Modes
  #1  
Old May 16th, 2008, 10:21 PM posted to microsoft.public.access.forms
Jason[_25_]
external usenet poster
 
Posts: 126
Default Can not get form to display Docmd.restore

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.


  #2  
Old May 18th, 2008, 05:41 PM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Can not get form to display Docmd.restore

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.


  #3  
Old May 23rd, 2008, 07:08 AM posted to microsoft.public.access.forms
Jason[_25_]
external usenet poster
 
Posts: 126
Default Can not get form to display Docmd.restore

Please read my post. It is already in there.
"strive4peace" wrote in message
...
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.




  #4  
Old May 23rd, 2008, 04:03 PM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Can not get form to display Docmd.restore

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.
"strive4peace" wrote in message
...
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.




  #5  
Old May 23rd, 2008, 09:52 PM posted to microsoft.public.access.forms
Jason[_25_]
external usenet poster
 
Posts: 126
Default Can not get form to display Docmd.restore

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" wrote in message
...
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.
"strive4peace" wrote in message
...
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.






  #6  
Old May 26th, 2008, 12:26 AM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Can not get form to display Docmd.restore

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.
"strive4peace" wrote in message
...
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.
"strive4peace" wrote in message
...
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.





  #7  
Old May 27th, 2008, 08:20 AM posted to microsoft.public.access.forms
Jason[_25_]
external usenet poster
 
Posts: 126
Default Can not get form to display Docmd.restore

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" wrote in message
...
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.
"strive4peace" wrote in message
...
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.
"strive4peace" wrote in message
...
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.







  #8  
Old June 13th, 2008, 10:22 PM posted to microsoft.public.access.forms
Jason[_25_]
external usenet poster
 
Posts: 126
Default Can not get form to display Docmd.restore

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" wrote in message
...
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" wrote in message
...
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.
"strive4peace" wrote in message
...
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.
"strive4peace" wrote in message
...
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.









  #9  
Old July 25th, 2008, 07:05 PM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Can not get form to display Docmd.restore

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
*




Jason wrote:
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" wrote in message
...
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.
"strive4peace" wrote in message
...
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.
"strive4peace" wrote in message
...
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.





  #10  
Old August 22nd, 2008, 04:56 AM posted to microsoft.public.access.forms
Jason[_25_]
external usenet poster
 
Posts: 126
Default Can not get form to display Docmd.restore

No - just added the docmd.restore and docmd.maximise after docmd.open
"strive4peace" wrote in message
...
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
*




Jason wrote:
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" wrote in message
...
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.
"strive4peace" wrote in message
...
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.
"strive4peace" wrote in message
...
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.







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.