| re: report on close
On Sun, 5 Jun 2005 12:10:44 +1200, windandwaves wrote:
[color=blue]
> 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[/color]
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. |