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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Report/Query question
I would like to open a report, and when the report is "closed",
I'd like to open a query. I have this code: DoCmd.OpenReport "rptMyReport", acViewPreview DoCmd.OpenQuery "qryMyQuery" When the code runs, the report opens in preview, and is immediately covered over by the query opening. Is there a way to keep the query from running until the report is closed. (I'd prefer not to code the opening of the query in the Report Close event, as other functions use this report also.) Thanks in advance, Al Camp |
#2
|
|||
|
|||
Report/Query question
On Fri, 14 May 2004 17:18:51 -0400, Al Camp wrote:
I would like to open a report, and when the report is "closed", I'd like to open a query. I have this code: DoCmd.OpenReport "rptMyReport", acViewPreview DoCmd.OpenQuery "qryMyQuery" When the code runs, the report opens in preview, and is immediately covered over by the query opening. Is there a way to keep the query from running until the report is closed. (I'd prefer not to code the opening of the query in the Report Close event, as other functions use this report also.) Thanks in advance, Al Camp If your version of Access supports opening a report in dialog: DoCmd.OpenReport "ReportName", acViewPreview, , , acDialog DoCmd.OpenQuery "QueryName" You'll need to close the report using the Report's close (X) button. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#3
|
|||
|
|||
Report/Query question
Fred,
Alas, I'm using Access2K, so acDialog is not an option. You know, I was really surprised that Access would allow the query to run at all... until the report closed. Seems to me that the report should maintain focus (control) of the code until it is closed. Well, perhaps someone else will have an idea... Thanks for your reply. Al Camp "fredg" wrote in message .. . On Fri, 14 May 2004 17:18:51 -0400, Al Camp wrote: I would like to open a report, and when the report is "closed", I'd like to open a query. I have this code: DoCmd.OpenReport "rptMyReport", acViewPreview DoCmd.OpenQuery "qryMyQuery" When the code runs, the report opens in preview, and is immediately covered over by the query opening. Is there a way to keep the query from running until the report is closed. (I'd prefer not to code the opening of the query in the Report Close event, as other functions use this report also.) Thanks in advance, Al Camp If your version of Access supports opening a report in dialog: DoCmd.OpenReport "ReportName", acViewPreview, , , acDialog DoCmd.OpenQuery "QueryName" You'll need to close the report using the Report's close (X) button. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#4
|
|||
|
|||
Report/Query question
well, you could create a public variable, as
Public blnOpenQuery As Boolean change DoCmd.OpenReport "rptMyReport", acViewPreview DoCmd.OpenQuery "qryMyQuery" to DoCmd.OpenReport "rptMyReport", acViewPreview blnOpenQuery = True in the report's OnClose event, add the following code, as If blnOpenQuery Then blnOpenQuery = False DoCmd.OpenQuery "qryMyQuery" End If when you open the report from another function, blnOpenQuery won't be True, so the query won't open when the report closes. hth "Al Camp" wrote in message ... Fred, Alas, I'm using Access2K, so acDialog is not an option. You know, I was really surprised that Access would allow the query to run at all... until the report closed. Seems to me that the report should maintain focus (control) of the code until it is closed. Well, perhaps someone else will have an idea... Thanks for your reply. Al Camp "fredg" wrote in message .. . On Fri, 14 May 2004 17:18:51 -0400, Al Camp wrote: I would like to open a report, and when the report is "closed", I'd like to open a query. I have this code: DoCmd.OpenReport "rptMyReport", acViewPreview DoCmd.OpenQuery "qryMyQuery" When the code runs, the report opens in preview, and is immediately covered over by the query opening. Is there a way to keep the query from running until the report is closed. (I'd prefer not to code the opening of the query in the Report Close event, as other functions use this report also.) Thanks in advance, Al Camp If your version of Access supports opening a report in dialog: DoCmd.OpenReport "ReportName", acViewPreview, , , acDialog DoCmd.OpenQuery "QueryName" You'll need to close the report using the Report's close (X) button. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#5
|
|||
|
|||
Report/Query question
"tina" wrote in message news well, you could create a public variable, as Public blnOpenQuery As Boolean change DoCmd.OpenReport "rptMyReport", acViewPreview DoCmd.OpenQuery "qryMyQuery" to DoCmd.OpenReport "rptMyReport", acViewPreview blnOpenQuery = True in the report's OnClose event, add the following code, as If blnOpenQuery Then blnOpenQuery = False DoCmd.OpenQuery "qryMyQuery" End If when you open the report from another function, blnOpenQuery won't be True, so the query won't open when the report closes. hth "Al Camp" wrote in message ... Fred, Alas, I'm using Access2K, so acDialog is not an option. You know, I was really surprised that Access would allow the query to run at all... until the report closed. Seems to me that the report should maintain focus (control) of the code until it is closed. Well, perhaps someone else will have an idea... Thanks for your reply. Al Camp "fredg" wrote in message .. . On Fri, 14 May 2004 17:18:51 -0400, Al Camp wrote: I would like to open a report, and when the report is "closed", I'd like to open a query. I have this code: DoCmd.OpenReport "rptMyReport", acViewPreview DoCmd.OpenQuery "qryMyQuery" When the code runs, the report opens in preview, and is immediately covered over by the query opening. Is there a way to keep the query from running until the report is closed. (I'd prefer not to code the opening of the query in the Report Close event, as other functions use this report also.) Thanks in advance, Al Camp If your version of Access supports opening a report in dialog: DoCmd.OpenReport "ReportName", acViewPreview, , , acDialog DoCmd.OpenQuery "QueryName" You'll need to close the report using the Report's close (X) button. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#6
|
|||
|
|||
Report/Query question
Thanks Tina,
I'll give that a try, but I did want to avoid using report code to solve the problem. Can't believe there isn't a more "simple" solution... I may try reposting... Thanks again, Al Camp "tina" wrote in message news well, you could create a public variable, as Public blnOpenQuery As Boolean change DoCmd.OpenReport "rptMyReport", acViewPreview DoCmd.OpenQuery "qryMyQuery" to DoCmd.OpenReport "rptMyReport", acViewPreview blnOpenQuery = True in the report's OnClose event, add the following code, as If blnOpenQuery Then blnOpenQuery = False DoCmd.OpenQuery "qryMyQuery" End If when you open the report from another function, blnOpenQuery won't be True, so the query won't open when the report closes. hth "Al Camp" wrote in message ... Fred, Alas, I'm using Access2K, so acDialog is not an option. You know, I was really surprised that Access would allow the query to run at all... until the report closed. Seems to me that the report should maintain focus (control) of the code until it is closed. Well, perhaps someone else will have an idea... Thanks for your reply. Al Camp "fredg" wrote in message .. . On Fri, 14 May 2004 17:18:51 -0400, Al Camp wrote: I would like to open a report, and when the report is "closed", I'd like to open a query. I have this code: DoCmd.OpenReport "rptMyReport", acViewPreview DoCmd.OpenQuery "qryMyQuery" When the code runs, the report opens in preview, and is immediately covered over by the query opening. Is there a way to keep the query from running until the report is closed. (I'd prefer not to code the opening of the query in the Report Close event, as other functions use this report also.) Thanks in advance, Al Camp If your version of Access supports opening a report in dialog: DoCmd.OpenReport "ReportName", acViewPreview, , , acDialog DoCmd.OpenQuery "QueryName" You'll need to close the report using the Report's close (X) button. -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
Thread Tools | |
Display Modes | |
|
|