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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query opens over report



 
 
Thread Tools Display Modes
  #1  
Old May 16th, 2004, 05:11 PM
Al Camp
external usenet poster
 
Posts: n/a
Default Query opens over report

Hello all,
I posted this question previously, but would appreciate any
further assistance anyone could give.

In Access2K I want to open a report in preview mode, and when
the user closes the report, I want to open a table for editing,
via a query.
However, the report opens in preview... and the query opens
right on top of it!

My Code:
DoCmd.OpenReport "rptMyReport", acViewPreview
DoCmd.OpenQuery "qryMyTableEditQuery"

How can I prevent the query from opening over the report?

I tried placing a msgbox after the report that said "Opening
Table for Edit" hoping that would stop the query from opening,
but it too popped up over the report!
I'd prefer not to use coding on the report OnClose event,
unless... there is no other reasonable solution.

Thanks in advance,
Al Camp







  #2  
Old May 16th, 2004, 10:27 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default Query opens over report

Why not put the DoCmd.OpenQuery statement in the report's OnClose property?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Al Camp" wrote in message
...
Hello all,
I posted this question previously, but would appreciate any
further assistance anyone could give.

In Access2K I want to open a report in preview mode, and when
the user closes the report, I want to open a table for editing,
via a query.
However, the report opens in preview... and the query opens
right on top of it!

My Code:
DoCmd.OpenReport "rptMyReport", acViewPreview
DoCmd.OpenQuery "qryMyTableEditQuery"

How can I prevent the query from opening over the report?

I tried placing a msgbox after the report that said "Opening
Table for Edit" hoping that would stop the query from opening,
but it too popped up over the report!
I'd prefer not to use coding on the report OnClose event,
unless... there is no other reasonable solution.

Thanks in advance,
Al Camp









  #3  
Old May 16th, 2004, 11:46 PM
Al Camp
external usenet poster
 
Posts: n/a
Default Query opens over report

Douglas,
If other code in the application opens that report, I wouldn't
want qryMyTableEditQuery opened in those instances. If I code
the report, then I'll have to set up some "who's calling" code
too.

If I have to code the report OnClose I will... but I just
wanted to make sure there's no other way to do it from the
calling form. Something that I may have missed perhaps...

I guess I'm also asking why I have to handle this at all. I
would think the Report Preview wouldn't relinquish control back
to the calling code until it's closed. Then all this would be a
moot issue...

Thanks for the help,
Al Camp

"Douglas J. Steele" wrote in
message ...
Why not put the DoCmd.OpenQuery statement in the report's

OnClose property?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Al Camp" wrote in message
...
Hello all,
I posted this question previously, but would appreciate

any
further assistance anyone could give.

In Access2K I want to open a report in preview mode, and

when
the user closes the report, I want to open a table for

editing,
via a query.
However, the report opens in preview... and the query

opens
right on top of it!

My Code:
DoCmd.OpenReport "rptMyReport", acViewPreview
DoCmd.OpenQuery "qryMyTableEditQuery"

How can I prevent the query from opening over the report?

I tried placing a msgbox after the report that said

"Opening
Table for Edit" hoping that would stop the query from

opening,
but it too popped up over the report!
I'd prefer not to use coding on the report OnClose event,
unless... there is no other reasonable solution.

Thanks in advance,
Al Camp











  #4  
Old May 17th, 2004, 02:58 AM
MacDermott
external usenet poster
 
Posts: n/a
Default Query opens over report

When you open a FORM in Access, using DoCmd.OpenForm, you have the option of
opening it Modal, which stops execution of the calling code until the new
form is either closed or hidden.
This sounds like the behavior you are looking for, but Access doesn't make
it available for REPORTS.
So -
one option is to redesign your report as a form. This may or may not be
feasible.
Another is to insert a loop after you call the report:
DoCmd.OpenReport "rptMyReport", acViewPreview
Do Until SysCmd(acSysCmdGetObjectState, acReport, "rptMyReport")=0
DoEvents
Loop
DoCmd.OpenQuery "qryMyTableEditQuery"

HTH
- Turtle


"Al Camp" wrote in message
...
Douglas,
If other code in the application opens that report, I wouldn't
want qryMyTableEditQuery opened in those instances. If I code
the report, then I'll have to set up some "who's calling" code
too.

If I have to code the report OnClose I will... but I just
wanted to make sure there's no other way to do it from the
calling form. Something that I may have missed perhaps...

I guess I'm also asking why I have to handle this at all. I
would think the Report Preview wouldn't relinquish control back
to the calling code until it's closed. Then all this would be a
moot issue...

Thanks for the help,
Al Camp

"Douglas J. Steele" wrote in
message ...
Why not put the DoCmd.OpenQuery statement in the report's

OnClose property?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Al Camp" wrote in message
...
Hello all,
I posted this question previously, but would appreciate

any
further assistance anyone could give.

In Access2K I want to open a report in preview mode, and

when
the user closes the report, I want to open a table for

editing,
via a query.
However, the report opens in preview... and the query

opens
right on top of it!

My Code:
DoCmd.OpenReport "rptMyReport", acViewPreview
DoCmd.OpenQuery "qryMyTableEditQuery"

How can I prevent the query from opening over the report?

I tried placing a msgbox after the report that said

"Opening
Table for Edit" hoping that would stop the query from

opening,
but it too popped up over the report!
I'd prefer not to use coding on the report OnClose event,
unless... there is no other reasonable solution.

Thanks in advance,
Al Camp













  #5  
Old May 17th, 2004, 03:56 AM
Al Camp
external usenet poster
 
Posts: n/a
Default Query opens over report

Turtle,
Thanks for the reply.
Probably won't go with a form... but I want to try your code
out! That's a bit more like what I'm looking for...

Thanks, and I'll try to get back to you on this thread...
Al Camp

"MacDermott" wrote in message
...
When you open a FORM in Access, using DoCmd.OpenForm, you have

the option of
opening it Modal, which stops execution of the calling code

until the new
form is either closed or hidden.
This sounds like the behavior you are looking for, but Access

doesn't make
it available for REPORTS.
So -
one option is to redesign your report as a form. This may

or may not be
feasible.
Another is to insert a loop after you call the report:
DoCmd.OpenReport "rptMyReport", acViewPreview
Do Until SysCmd(acSysCmdGetObjectState, acReport,

"rptMyReport")=0
DoEvents
Loop
DoCmd.OpenQuery "qryMyTableEditQuery"

HTH
- Turtle


"Al Camp" wrote in message
...
Douglas,
If other code in the application opens that report, I

wouldn't
want qryMyTableEditQuery opened in those instances. If I

code
the report, then I'll have to set up some "who's calling"

code
too.

If I have to code the report OnClose I will... but I just
wanted to make sure there's no other way to do it from the
calling form. Something that I may have missed perhaps...

I guess I'm also asking why I have to handle this at all.

I
would think the Report Preview wouldn't relinquish control

back
to the calling code until it's closed. Then all this would

be a
moot issue...

Thanks for the help,
Al Camp

"Douglas J. Steele" wrote

in
message ...
Why not put the DoCmd.OpenQuery statement in the report's

OnClose property?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Al Camp" wrote in message
...
Hello all,
I posted this question previously, but would

appreciate
any
further assistance anyone could give.

In Access2K I want to open a report in preview mode,

and
when
the user closes the report, I want to open a table for

editing,
via a query.
However, the report opens in preview... and the query

opens
right on top of it!

My Code:
DoCmd.OpenReport "rptMyReport", acViewPreview
DoCmd.OpenQuery "qryMyTableEditQuery"

How can I prevent the query from opening over the

report?

I tried placing a msgbox after the report that said

"Opening
Table for Edit" hoping that would stop the query from

opening,
but it too popped up over the report!
I'd prefer not to use coding on the report OnClose

event,
unless... there is no other reasonable solution.

Thanks in advance,
Al Camp















  #6  
Old May 17th, 2004, 04:01 AM
Al Camp
external usenet poster
 
Posts: n/a
Default Query opens over report

Turtle,
Well, it only took me 5 minutes to try your code out... and it
worked like a champ. Thanks a lot... that's just the little
"workaround" I was looking for.
I owe ya one! Thanks!
Al Camp

"MacDermott" wrote in message
...
When you open a FORM in Access, using DoCmd.OpenForm, you have

the option of
opening it Modal, which stops execution of the calling code

until the new
form is either closed or hidden.
This sounds like the behavior you are looking for, but Access

doesn't make
it available for REPORTS.
So -
one option is to redesign your report as a form. This may

or may not be
feasible.
Another is to insert a loop after you call the report:
DoCmd.OpenReport "rptMyReport", acViewPreview
Do Until SysCmd(acSysCmdGetObjectState, acReport,

"rptMyReport")=0
DoEvents
Loop
DoCmd.OpenQuery "qryMyTableEditQuery"

HTH
- Turtle


"Al Camp" wrote in message
...
Douglas,
If other code in the application opens that report, I

wouldn't
want qryMyTableEditQuery opened in those instances. If I

code
the report, then I'll have to set up some "who's calling"

code
too.

If I have to code the report OnClose I will... but I just
wanted to make sure there's no other way to do it from the
calling form. Something that I may have missed perhaps...

I guess I'm also asking why I have to handle this at all.

I
would think the Report Preview wouldn't relinquish control

back
to the calling code until it's closed. Then all this would

be a
moot issue...

Thanks for the help,
Al Camp

"Douglas J. Steele" wrote

in
message ...
Why not put the DoCmd.OpenQuery statement in the report's

OnClose property?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Al Camp" wrote in message
...
Hello all,
I posted this question previously, but would

appreciate
any
further assistance anyone could give.

In Access2K I want to open a report in preview mode,

and
when
the user closes the report, I want to open a table for

editing,
via a query.
However, the report opens in preview... and the query

opens
right on top of it!

My Code:
DoCmd.OpenReport "rptMyReport", acViewPreview
DoCmd.OpenQuery "qryMyTableEditQuery"

How can I prevent the query from opening over the

report?

I tried placing a msgbox after the report that said

"Opening
Table for Edit" hoping that would stop the query from

opening,
but it too popped up over the report!
I'd prefer not to use coding on the report OnClose

event,
unless... there is no other reasonable solution.

Thanks in advance,
Al Camp















  #7  
Old May 17th, 2004, 04:35 AM
Al Camp
external usenet poster
 
Posts: n/a
Default Query opens over report

Turtle,
Well, looks as though I jumped the gun a bit. In my haste, I
had the OpenQuery rem'd out when I first tested. When the report
wasnt covered up, I thought we had it. Doh!!
Problem still remains, but I'll keep working in the direction
you suggested. And as I say, I'll use the report OnClose if I
have to.
Thanks,
Al Camp

"MacDermott" wrote in message
...
When you open a FORM in Access, using DoCmd.OpenForm, you have

the option of
opening it Modal, which stops execution of the calling code

until the new
form is either closed or hidden.
This sounds like the behavior you are looking for, but Access

doesn't make
it available for REPORTS.
So -
one option is to redesign your report as a form. This may

or may not be
feasible.
Another is to insert a loop after you call the report:
DoCmd.OpenReport "rptMyReport", acViewPreview
Do Until SysCmd(acSysCmdGetObjectState, acReport,

"rptMyReport")=0
DoEvents
Loop
DoCmd.OpenQuery "qryMyTableEditQuery"

HTH
- Turtle


"Al Camp" wrote in message
...
Douglas,
If other code in the application opens that report, I

wouldn't
want qryMyTableEditQuery opened in those instances. If I

code
the report, then I'll have to set up some "who's calling"

code
too.

If I have to code the report OnClose I will... but I just
wanted to make sure there's no other way to do it from the
calling form. Something that I may have missed perhaps...

I guess I'm also asking why I have to handle this at all.

I
would think the Report Preview wouldn't relinquish control

back
to the calling code until it's closed. Then all this would

be a
moot issue...

Thanks for the help,
Al Camp

"Douglas J. Steele" wrote

in
message ...
Why not put the DoCmd.OpenQuery statement in the report's

OnClose property?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Al Camp" wrote in message
...
Hello all,
I posted this question previously, but would

appreciate
any
further assistance anyone could give.

In Access2K I want to open a report in preview mode,

and
when
the user closes the report, I want to open a table for

editing,
via a query.
However, the report opens in preview... and the query

opens
right on top of it!

My Code:
DoCmd.OpenReport "rptMyReport", acViewPreview
DoCmd.OpenQuery "qryMyTableEditQuery"

How can I prevent the query from opening over the

report?

I tried placing a msgbox after the report that said

"Opening
Table for Edit" hoping that would stop the query from

opening,
but it too popped up over the report!
I'd prefer not to use coding on the report OnClose

event,
unless... there is no other reasonable solution.

Thanks in advance,
Al Camp















 




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 06:01 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.