473,480 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to "hold" execution

Hi

I have this code as below that first runs a report and then an update query
to set a flag so these records are not included in the report next time.

Private Sub Command2_Click()
DoCmd.OpenReport "MyReport", acViewPreview
DoCmd.OpenQuery "MyQuery"
End Sub

The problem is that as the report comes up the code execution continues and
the query is also run to set the flags. The result is that the report is
unable to show all the records as flags of some records are already set by
the query while report is being loaded. How can I "halt" the execution at
report stage and only allow the query to run when user has closed the
report?

Thanks

Regards
Nov 13 '05 #1
6 3594
DoCmd.OpenReport "MyReport", acViewPreview, , , acDialog

The 5th parameter of the OpenReport is the WindowMode. acDialog halts
execution in the current form until the report is closed (among other
things).

Nov 13 '05 #2
ab****@centurytel.net wrote:
DoCmd.OpenReport "MyReport", acViewPreview, , , acDialog

The 5th parameter of the OpenReport is the WindowMode. acDialog halts
execution in the current form until the report is closed (among other
things).


Only in A2002 or A2003 though right?

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #3
Something of a kludge maybe:
wrap the opening of the report in a modal form. That is, you need a very
simple form, (probably just an OK button of 1x1 cm) with in its Open
event the docmd.openreport statement. Drawback is, however, that this
form then is, well, modal. You cannot view the whole report at once
because that form is in the way.

John wrote:
Hi

I have this code as below that first runs a report and then an update query
to set a flag so these records are not included in the report next time.

Private Sub Command2_Click()
DoCmd.OpenReport "MyReport", acViewPreview
DoCmd.OpenQuery "MyQuery"
End Sub

The problem is that as the report comes up the code execution continues and
the query is also run to set the flags. The result is that the report is
unable to show all the records as flags of some records are already set by
the query while report is being loaded. How can I "halt" the execution at
report stage and only allow the query to run when user has closed the
report?

Thanks

Regards


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

Nov 13 '05 #4
Not in A97, at least! openForm has that argument, openReport doesn't.

ab****@centurytel.net wrote:
DoCmd.OpenReport "MyReport", acViewPreview, , , acDialog

The 5th parameter of the OpenReport is the WindowMode. acDialog halts
execution in the current form until the report is closed (among other
things).


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

Nov 13 '05 #5
On Sun, 3 Jul 2005 18:10:07 +0100, John wrote:
Hi

I have this code as below that first runs a report and then an update query
to set a flag so these records are not included in the report next time.

Private Sub Command2_Click()
DoCmd.OpenReport "MyReport", acViewPreview
DoCmd.OpenQuery "MyQuery"
End Sub

The problem is that as the report comes up the code execution continues and
the query is also run to set the flags. The result is that the report is
unable to show all the records as flags of some records are already set by
the query while report is being loaded. How can I "halt" the execution at
report stage and only allow the query to run when user has closed the
report?

Thanks

Regards


Only open the report from the Command button event.

Place the OpenQuery code in the Report's Close event (or the Report
Footer Format event).

Note: You are running the report in preview. Is that what you want?
The query will update the records after preview. If you then decide to
Print the report, they will appear to have already been printed.

If you wish to update the table records only after the report has been
printed (not previewed), search
http://www.groups.google.com
for my reply to the thread started by Stephanie with the subject of
'Knowing what you've printed' dated 6/23/2005 in
microsoft.public.access.reports.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #6
"John" <Jo**@nospam.infovis.co.uk> wrote in
news:42***********************@news-text.dial.pipex.com:
I have this code as below that first runs a report and then an
update query to set a flag so these records are not included in
the report next time.

Private Sub Command2_Click()
DoCmd.OpenReport "MyReport", acViewPreview
DoCmd.OpenQuery "MyQuery"
End Sub

The problem is that as the report comes up the code execution
continues and the query is also run to set the flags. The result
is that the report is unable to show all the records as flags of
some records are already set by the query while report is being
loaded. How can I "halt" the execution at report stage and only
allow the query to run when user has closed the report?


Run the query in the report's OnClose event.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

40
2983
by: Steve Juranich | last post by:
I know that this topic has the potential for blowing up in my face, but I can't help asking. I've been using Python since 1.5.1, so I'm not what you'd call a "n00b". I dutifully evangelize on the...
28
2380
by: Alf P. Steinbach | last post by:
A few days ago I posted an "Hello, world!" tutorial, discussed in <url: http://groups.google.no/groups?threadm=41ba4c0a.76869078@news.individual.net>. As I wrote then: <quote> because there...
0
1590
by: 4.spam | last post by:
Hello. W2K, DB2 ESE V8.2.1 I created a dummy sql sp that returns 2 result sets. One of cursors inside it I declared as "with hold with return" and another as "with return" (without "with...
388
21392
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
11
8858
by: L. Chen | last post by:
The standard says that a char* or void* pointer has the least strict alignment. But I do not know what is a strict alignment. What does that mean?
49
14426
by: matty | last post by:
Hi, I recently got very confused (well that's my life) about the "undefined" value. I looked in the FAQ and didn't see anything about it. On...
26
2108
by: Patient Guy | last post by:
The code below shows the familiar way of restricting a function to be a method of a constructed object: function aConstructor(arg) { if (typeof(arg) == "undefined") return (null);...
33
3231
by: Snis Pilbor | last post by:
With the "as if" rule in play, doesn't that effectively render the "register" keyword completely useless? Example: I make a silly compiler which creates code that goes out of its way to take a...
3
1852
by: vbace2 | last post by:
Hi. I am using DB2 v9.1 fixpack 2. I was wondering if there is a way to use the with hold option when using the prepare statement. Or, is there another way that I can do what I need to? I...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.