WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Closing A Report

 
   Home -> Office other -> Reports RSS
Next:  Reports: Chart Novice  
Author Message
DS

External


Since: Jan 12, 2007
Posts: 101



(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
Back to top
Login to vote
Al Campagna

External


Since: Aug 23, 2007
Posts: 343



(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
>
Back to top
Login to vote
DS

External


Since: Jan 12, 2007
Posts: 101



(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?)

Great, Thanks.
DS
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Reports 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
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET