(Msg. 1) Posted: Thu Jul 24, 2008 12:13 am
Post subject: Closing A Report Add to elertz Archived from groups: microsoft>public>access>reports (more info?)
I have on the On Close Property of a report preview, a form opens asking you
if you want to print or just close. This works fine except when there is No
data. The form still opens. Is there a way to stop this poping up if there
is no data or do I need it on another event instead of close.
Thanks
DS
(Msg. 2) Posted: Thu Jul 24, 2008 10:24 am
Post subject: Re: Closing A Report Add to elertz [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
DS,
Probably a better solution would be to ditch the pop up form. The
normal way to accomplish what you want is to open the report in Preview, and
let the user use the Menu Bar to Print, or Close, the report. You could
even create a custom report preview menu... with just a Close or Print icon,
if security is an issue.
First... here's a routine to handle a NoData situation
In your form, on the button Click event...
Private Sub cmdRunMyReport_Click()
On Error Resume Next
DoCmd.OpenReport "rptYourReportNme", acViewPreview
End Sub
Then on the report's NoData event....
Private Sub Report_NoData(Cancel As Integer)
Beep
"There are no records that match the criteria."
MsgBox "There are no records that match the criteria.", vbOKOnly
Cancel = True
End Sub
You could use the NoData event to set a variable like DontShowPopUp =
True.
Then... in the Close event code, use an IF statement to not show the
pop-up if DontShowPopUp = True
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your life."
"DS" <bootybox RemoveThis @optonline.net> wrote in message
news:eZGxnOU7IHA.5024@TK2MSFTNGP03.phx.gbl...
>I have on the On Close Property of a report preview, a form opens asking
>you if you want to print or just close. This works fine except when there
>is No data. The form still opens. Is there a way to stop this poping up
>if there is no data or do I need it on another event instead of close.
> Thanks
> DS
>
(Msg. 3) Posted: Thu Jul 24, 2008 12:58 pm
Post subject: Re: Closing A Report Add to elertz [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum