Access 2003 Forms

G

Guest

Recently switched from Access 97 to Access 2003. I have a form which
contains command buttons to open various reports in Print Preview. Shortly
after I open any report using these command buttons the Form reappears,
covering up the report I was viewing in Print Preview. This never occured in
Access 97. How can I stop it from happening in Access 2003?

Any help appreciated - Pete
 
A

Allen Browne

This is not normal behavior.

Is you form opened as a popup form (i.e. with its PopUp property set to
Yes)?

Was the report already open in the background?

What code is in the command button that could cause the form to get focus
again?

Anything in the events of the report, or the Deactivate event of the form?
 
G

Guest

PopUp property is set to 'No'.
The command button only uses an [Event Procedure] in the On Click property
to open the report in Print Preview. No other code in the command button.
Only event in the report properties being used is to Maximize the report and
this is done in the On Open event.
The Deactivate event of the form is not being used.

Any other ideas??

Tks - Pete
 
A

Allen Browne

The Open event of the report runs before the report is visible.
I'll bet that the Maximize in this event is being applied to your form.
Comment it out to test that idea.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Sperling said:
PopUp property is set to 'No'.
The command button only uses an [Event Procedure] in the On Click property
to open the report in Print Preview. No other code in the command button.
Only event in the report properties being used is to Maximize the report
and
this is done in the On Open event.
The Deactivate event of the form is not being used.

Any other ideas??

Tks - Pete

Allen Browne said:
This is not normal behavior.

Is you form opened as a popup form (i.e. with its PopUp property set to
Yes)?

Was the report already open in the background?

What code is in the command button that could cause the form to get focus
again?

Anything in the events of the report, or the Deactivate event of the
form?
 
G

Guest

Why would this only apply to Access 2003 - there was never any impact to
Access '97. I will try removing the Maximize from the OnOpen event in the
report to see if it has any effect.

Tks - Pete

Allen Browne said:
The Open event of the report runs before the report is visible.
I'll bet that the Maximize in this event is being applied to your form.
Comment it out to test that idea.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Sperling said:
PopUp property is set to 'No'.
The command button only uses an [Event Procedure] in the On Click property
to open the report in Print Preview. No other code in the command button.
Only event in the report properties being used is to Maximize the report
and
this is done in the On Open event.
The Deactivate event of the form is not being used.

Any other ideas??

Tks - Pete

Allen Browne said:
This is not normal behavior.

Is you form opened as a popup form (i.e. with its PopUp property set to
Yes)?

Was the report already open in the background?

What code is in the command button that could cause the form to get focus
again?

Anything in the events of the report, or the Deactivate event of the
form?


Recently switched from Access 97 to Access 2003. I have a form which
contains command buttons to open various reports in Print Preview.
Shortly
after I open any report using these command buttons the Form reappears,
covering up the report I was viewing in Print Preview. This never
occured
in
Access 97. How can I stop it from happening in Access 2003?

Any help appreciated - Pete
 
G

Guest

Removing the MAXIMIZE from the OnOpen event property of the report has no
effect.

Any other ideas?

Tks - Pete

Allen Browne said:
The Open event of the report runs before the report is visible.
I'll bet that the Maximize in this event is being applied to your form.
Comment it out to test that idea.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Sperling said:
PopUp property is set to 'No'.
The command button only uses an [Event Procedure] in the On Click property
to open the report in Print Preview. No other code in the command button.
Only event in the report properties being used is to Maximize the report
and
this is done in the On Open event.
The Deactivate event of the form is not being used.

Any other ideas??

Tks - Pete

Allen Browne said:
This is not normal behavior.

Is you form opened as a popup form (i.e. with its PopUp property set to
Yes)?

Was the report already open in the background?

What code is in the command button that could cause the form to get focus
again?

Anything in the events of the report, or the Deactivate event of the
form?


Recently switched from Access 97 to Access 2003. I have a form which
contains command buttons to open various reports in Print Preview.
Shortly
after I open any report using these command buttons the Form reappears,
covering up the report I was viewing in Print Preview. This never
occured
in
Access 97. How can I stop it from happening in Access 2003?

Any help appreciated - Pete
 
A

Allen Browne

Pete, I can't repro your issue here - with or without the maximize - so
there must be another factor at work.

Anything else, such as code in a timer event?

Post the exact code used to open the report, and in the report's events.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Sperling said:
Removing the MAXIMIZE from the OnOpen event property of the report has no
effect.

Any other ideas?

Tks - Pete

Allen Browne said:
The Open event of the report runs before the report is visible.
I'll bet that the Maximize in this event is being applied to your form.
Comment it out to test that idea.

Pete Sperling said:
PopUp property is set to 'No'.
The command button only uses an [Event Procedure] in the On Click
property
to open the report in Print Preview. No other code in the command
button.
Only event in the report properties being used is to Maximize the
report
and
this is done in the On Open event.
The Deactivate event of the form is not being used.

Any other ideas??

Tks - Pete

:

This is not normal behavior.

Is you form opened as a popup form (i.e. with its PopUp property set
to
Yes)?

Was the report already open in the background?

What code is in the command button that could cause the form to get
focus
again?

Anything in the events of the report, or the Deactivate event of the
form?


message
Recently switched from Access 97 to Access 2003. I have a form
which
contains command buttons to open various reports in Print Preview.
Shortly
after I open any report using these command buttons the Form
reappears,
covering up the report I was viewing in Print Preview. This never
occured
in
Access 97. How can I stop it from happening in Access 2003?

Any help appreciated - Pete
 
G

Guest

No time event that I'm aware of.
Here's the code that opens the report:

Private Sub Command141_Click()
On Error GoTo Err_Command141_Click

Dim stDocName As String

stDocName = "DRAWINGS ANT"
DoCmd.OpenReport stDocName, acPreview

Exit_Command141_Click:
Exit Sub

Err_Command141_Click:
MsgBox Err.Description
Resume Exit_Command141_Click

End Sub

Also - there are no events in the report that have any code associated with
them.

Tks for any help - Pete


Allen Browne said:
Pete, I can't repro your issue here - with or without the maximize - so
there must be another factor at work.

Anything else, such as code in a timer event?

Post the exact code used to open the report, and in the report's events.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Sperling said:
Removing the MAXIMIZE from the OnOpen event property of the report has no
effect.

Any other ideas?

Tks - Pete

Allen Browne said:
The Open event of the report runs before the report is visible.
I'll bet that the Maximize in this event is being applied to your form.
Comment it out to test that idea.

PopUp property is set to 'No'.
The command button only uses an [Event Procedure] in the On Click
property
to open the report in Print Preview. No other code in the command
button.
Only event in the report properties being used is to Maximize the
report
and
this is done in the On Open event.
The Deactivate event of the form is not being used.

Any other ideas??

Tks - Pete

:

This is not normal behavior.

Is you form opened as a popup form (i.e. with its PopUp property set
to
Yes)?

Was the report already open in the background?

What code is in the command button that could cause the form to get
focus
again?

Anything in the events of the report, or the Deactivate event of the
form?


message
Recently switched from Access 97 to Access 2003. I have a form
which
contains command buttons to open various reports in Print Preview.
Shortly
after I open any report using these command buttons the Form
reappears,
covering up the report I was viewing in Print Preview. This never
occured
in
Access 97. How can I stop it from happening in Access 2003?

Any help appreciated - Pete
 
A

Allen Browne

That's pretty standard code, and does not cause the problem you describe. I
take it that you have removed the Maximize from the report's Open event now,
and that the problem still occurs.

The faulty behavior therefore suggests there is some kind of corruption. See
if this fixes it:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Open the report in design view. Open the Properties box (View menu). On
the Other tab of the properties box, looking at the properties of the
report, set HasModule to No. If it was Yes, Access warns you are about to
destroy the report's module. Answer Yes.

3. Compact the database:
Tools | Database Utilities | Compact

4. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

5. Open Access, and compact again.

6. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

7. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, the report's faulty module is gone,
inconsistencies between the text- and compiled-versions of the code are
fixed, and reference ambiguities are resolved.

If it is still a problem, the next step would be to get Access to rebuild
the database for you. Follow the steps for the first symptom in this
article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Sperling said:
No time event that I'm aware of.
Here's the code that opens the report:

Private Sub Command141_Click()
On Error GoTo Err_Command141_Click

Dim stDocName As String

stDocName = "DRAWINGS ANT"
DoCmd.OpenReport stDocName, acPreview

Exit_Command141_Click:
Exit Sub

Err_Command141_Click:
MsgBox Err.Description
Resume Exit_Command141_Click

End Sub

Also - there are no events in the report that have any code associated
with
them.

Tks for any help - Pete


Allen Browne said:
Pete, I can't repro your issue here - with or without the maximize - so
there must be another factor at work.

Anything else, such as code in a timer event?

Post the exact code used to open the report, and in the report's events.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Sperling said:
Removing the MAXIMIZE from the OnOpen event property of the report has
no
effect.

Any other ideas?

Tks - Pete

:

The Open event of the report runs before the report is visible.
I'll bet that the Maximize in this event is being applied to your
form.
Comment it out to test that idea.

message
PopUp property is set to 'No'.
The command button only uses an [Event Procedure] in the On Click
property
to open the report in Print Preview. No other code in the command
button.
Only event in the report properties being used is to Maximize the
report
and
this is done in the On Open event.
The Deactivate event of the form is not being used.

Any other ideas??

Tks - Pete

:

This is not normal behavior.

Is you form opened as a popup form (i.e. with its PopUp property
set
to
Yes)?

Was the report already open in the background?

What code is in the command button that could cause the form to get
focus
again?

Anything in the events of the report, or the Deactivate event of
the
form?


message
Recently switched from Access 97 to Access 2003. I have a form
which
contains command buttons to open various reports in Print
Preview.
Shortly
after I open any report using these command buttons the Form
reappears,
covering up the report I was viewing in Print Preview. This
never
occured
in
Access 97. How can I stop it from happening in Access 2003?

Any help appreciated - Pete
 
G

Guest

Allen - I fixed the problem by creating two Macros. One to close the form and
one to open the form. I added the 'close form' macro to the 'OnOpen'
property of each report and added the 'open form' macro to the 'OnClose'
property of each report.

I have a feeling that this problem was specific to one database only. I
have many other databases which we use that do not have the same problem.

Thanks for your assistance - Pete

Allen Browne said:
That's pretty standard code, and does not cause the problem you describe. I
take it that you have removed the Maximize from the report's Open event now,
and that the problem still occurs.

The faulty behavior therefore suggests there is some kind of corruption. See
if this fixes it:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Open the report in design view. Open the Properties box (View menu). On
the Other tab of the properties box, looking at the properties of the
report, set HasModule to No. If it was Yes, Access warns you are about to
destroy the report's module. Answer Yes.

3. Compact the database:
Tools | Database Utilities | Compact

4. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

5. Open Access, and compact again.

6. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

7. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, the report's faulty module is gone,
inconsistencies between the text- and compiled-versions of the code are
fixed, and reference ambiguities are resolved.

If it is still a problem, the next step would be to get Access to rebuild
the database for you. Follow the steps for the first symptom in this
article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Sperling said:
No time event that I'm aware of.
Here's the code that opens the report:

Private Sub Command141_Click()
On Error GoTo Err_Command141_Click

Dim stDocName As String

stDocName = "DRAWINGS ANT"
DoCmd.OpenReport stDocName, acPreview

Exit_Command141_Click:
Exit Sub

Err_Command141_Click:
MsgBox Err.Description
Resume Exit_Command141_Click

End Sub

Also - there are no events in the report that have any code associated
with
them.

Tks for any help - Pete


Allen Browne said:
Pete, I can't repro your issue here - with or without the maximize - so
there must be another factor at work.

Anything else, such as code in a timer event?

Post the exact code used to open the report, and in the report's events.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Removing the MAXIMIZE from the OnOpen event property of the report has
no
effect.

Any other ideas?

Tks - Pete

:

The Open event of the report runs before the report is visible.
I'll bet that the Maximize in this event is being applied to your
form.
Comment it out to test that idea.

message
PopUp property is set to 'No'.
The command button only uses an [Event Procedure] in the On Click
property
to open the report in Print Preview. No other code in the command
button.
Only event in the report properties being used is to Maximize the
report
and
this is done in the On Open event.
The Deactivate event of the form is not being used.

Any other ideas??

Tks - Pete

:

This is not normal behavior.

Is you form opened as a popup form (i.e. with its PopUp property
set
to
Yes)?

Was the report already open in the background?

What code is in the command button that could cause the form to get
focus
again?

Anything in the events of the report, or the Deactivate event of
the
form?


message
Recently switched from Access 97 to Access 2003. I have a form
which
contains command buttons to open various reports in Print
Preview.
Shortly
after I open any report using these command buttons the Form
reappears,
covering up the report I was viewing in Print Preview. This
never
occured
in
Access 97. How can I stop it from happening in Access 2003?

Any help appreciated - Pete
 
V

villy565msn.com

Pete Sperling said:
Allen - I fixed the problem by creating two Macros. One to close the form
and
one to open the form. I added the 'close form' macro to the 'OnOpen'
property of each report and added the 'open form' macro to the 'OnClose'
property of each report.

I have a feeling that this problem was specific to one database only. I
have many other databases which we use that do not have the same problem.

Thanks for your assistance - Pete

Allen Browne said:
That's pretty standard code, and does not cause the problem you describe.
I
take it that you have removed the Maximize from the report's Open event
now,
and that the problem still occurs.

The faulty behavior therefore suggests there is some kind of corruption.
See
if this fixes it:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Open the report in design view. Open the Properties box (View menu).
On
the Other tab of the properties box, looking at the properties of the
report, set HasModule to No. If it was Yes, Access warns you are about to
destroy the report's module. Answer Yes.

3. Compact the database:
Tools | Database Utilities | Compact

4. Close Access. Make a backup copy of the file. Decompile the database
by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

5. Open Access, and compact again.

6. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

7. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the name-autocorrect
errors
are gone, the indexes are repaired, the report's faulty module is gone,
inconsistencies between the text- and compiled-versions of the code are
fixed, and reference ambiguities are resolved.

If it is still a problem, the next step would be to get Access to rebuild
the database for you. Follow the steps for the first symptom in this
article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Sperling said:
No time event that I'm aware of.
Here's the code that opens the report:

Private Sub Command141_Click()
On Error GoTo Err_Command141_Click

Dim stDocName As String

stDocName = "DRAWINGS ANT"
DoCmd.OpenReport stDocName, acPreview

Exit_Command141_Click:
Exit Sub

Err_Command141_Click:
MsgBox Err.Description
Resume Exit_Command141_Click

End Sub

Also - there are no events in the report that have any code associated
with
them.

Tks for any help - Pete


:

Pete, I can't repro your issue here - with or without the maximize -
so
there must be another factor at work.

Anything else, such as code in a timer event?

Post the exact code used to open the report, and in the report's
events.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
Removing the MAXIMIZE from the OnOpen event property of the report
has
no
effect.

Any other ideas?

Tks - Pete

:

The Open event of the report runs before the report is visible.
I'll bet that the Maximize in this event is being applied to your
form.
Comment it out to test that idea.

message
PopUp property is set to 'No'.
The command button only uses an [Event Procedure] in the On Click
property
to open the report in Print Preview. No other code in the
command
button.
Only event in the report properties being used is to Maximize the
report
and
this is done in the On Open event.
The Deactivate event of the form is not being used.

Any other ideas??

Tks - Pete

:

This is not normal behavior.

Is you form opened as a popup form (i.e. with its PopUp property
set
to
Yes)?

Was the report already open in the background?

What code is in the command button that could cause the form to
get
focus
again?

Anything in the events of the report, or the Deactivate event of
the
form?


in
message
Recently switched from Access 97 to Access 2003. I have a
form
which
contains command buttons to open various reports in Print
Preview.
Shortly
after I open any report using these command buttons the Form
reappears,
covering up the report I was viewing in Print Preview. This
never
occured
in
Access 97. How can I stop it from happening in Access 2003?

Any help appreciated - Pete
 

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