By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

report on close

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.