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