473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

report on close

Hi Gurus

I have a bunch of reports where I have added the following function to the
onclose event:

=FROC()

where FROC() opens a form.

However, i found that if i have a report with more than one page, froc is
executed when I go from page 1 to page 2. Is there a way to stop this from
happening?

TIA

- Nicolaas
Nov 13 '05 #1
3 1547
windandwaves wrote:
Hi Gurus

I have a bunch of reports where I have added the following function
to the onclose event:

=FROC()

where FROC() opens a form.

However, i found that if i have a report with more than one page,
froc is executed when I go from page 1 to page 2. Is there a way to
stop this from happening?

TIA

- Nicolaas


as i added =FROC() to all my reports, could it be the case that it is
related to a subform?
Nov 13 '05 #2
On Sun, 5 Jun 2005 12:10:44 +1200, windandwaves wrote:
Hi Gurus

I have a bunch of reports where I have added the following function to the
onclose event:

=FROC()

where FROC() opens a form.

However, i found that if i have a report with more than one page, froc is
executed when I go from page 1 to page 2. Is there a way to stop this from
happening?

TIA

- Nicolaas


If the form is opening as you go from page to page, you have something
else opening the form, not this code.

1) Writing
=FROC()
(as you have posted it) in the close event will cause a compile error.

2) If all you are doing with the function is opening a form, you don't
need a function. A function is used to return a value. No value is
being returned.

You can open it directly in the close event using:
DoCmd.OpenForm "FormName"

3) If for some reason you need to do it outside of the close event, a
sub procedure would be more suitable than a function:

Sub FROC()
DoCmd.OpenForm "FormName"
End Sub

In the Close event you would then call the procedure using:
froc

No = sign and no parenthesis.

The above will only fire when the report is closed.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #3
On Sun, 5 Jun 2005 12:10:44 +1200, "windandwaves"
<wi*********@coldmail.com> wrote:

I can't reproduce that if I write:
Private Sub Report_Close()
MsgBox "Report_Close"
End Sub
in a Northwind sample report. Set a breakpoint at the top of the
function and review the call stack. Something else may be calling your
function.

-Tom.

Hi Gurus

I have a bunch of reports where I have added the following function to the
onclose event:

=FROC()

where FROC() opens a form.

However, i found that if i have a report with more than one page, froc is
executed when I go from page 1 to page 2. Is there a way to stop this from
happening?

TIA

- Nicolaas


Nov 13 '05 #4

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

Similar topics

4
by: deko | last post by:
I can't move a multi-page report to the last record unless I keep the popup form (that defined it's subreports) open. DoCmd.OpenReport "rptStandard", acViewNormal DoCmd.Close acForm,...
1
by: Michael Wiseley | last post by:
I would like to make a user report automatically close after it has been left open in preview mode for more than 1 hour. I don't see a timer control or timer event in the report properties. Is...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
2
by: Lloyd Stevens | last post by:
I'm trying to create a report from two queries, one query displays which customers bought a particular product, the quantity and price using the "Enter productID" as parameter While the other is...
3
by: Phil Stanton | last post by:
In code I am opening a report in deign view, adding code to the report to output it to Word in an editable form. I then want t close the report but not save the changes. Is there any way or...
2
by: CSDunn | last post by:
Hello, I have an Access 2003 report that opens in print preview and then maximizes upon clicking a button from a form. The OnClick event of the button fires a macro to open the report. How can...
2
by: Denise | last post by:
How do I get the report to not spend time pulling up the data when I'm going to bail out of the report anyway? Below is the code in my report. I first show the user a form where they can select...
0
by: bonita | last post by:
In my ASP.NET page, I have 2 checkboxes for users to choose which crystal report they want to display. These two reports use different tables. If report1 has been choosen and displayed in the...
5
by: sara | last post by:
I have reports that run from a form where the user can choose a date range, or they run automatically for a week in the "Weekly Reports" option. I created 2 queries and 2 reports - one query...
1
by: Elainie | last post by:
I have a form with 2 fields on it, one for directorate and the other for quarter's i.e. 1,2,3,4 if a certain directorate and quarter is selected go and get a certain report, that I have built...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.