Joe
In the NoData event put
Private Sub Report_NoData(Cancel As Integer)
'MsgBox "The report has no data, check the dates.", , "No Data"
' Cancel = True
Dim blnOK As Boolean
blnOK = Confirm("There is no data to report. Please check the dates that you
entered")
Cancel = True
End Sub
Create a new module and copy this code into the vbe
Option Compare Database
Option Explicit
Const conAppName = "Name of database"
Public Sub DisplayMessage(strMessage As String)
'Display an importante message to the user. this will let the user know that
there is no data in the report
'that they are running.
MsgBox strMessage, vbExclamation, conAppName
End Sub
Public Function Confirm(strMessage As String)
'Ask the user to confirm an action, returning true or false.
Dim bytChoice As Byte
bytChoice = MsgBox(strMessage, , conAppName)
If bytChoice = vbOK Then
Confirm = True
Else
Confirm = False
End If
End Function
You will be able to call the module from anywhere.
Jim Wagner
eliotchs <[EMAIL PROTECTED]> wrote:
Hi,
I have a form which asks for month(cboMonth) & Year(cboyear).
when user chooses a report from a button, it runs that report for month
and year. The problem is I get a blank reort with "error" in the data
fields if no data exists. Can I get a messagebox, which state "No
data".. before the report runs, if there is no data?
Thanks In Advance
Joe
SPONSORED LINKS
Microsoft access database Database development software Database
management software Database software Inventory database software
Membership database software
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "ms_access" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Yahoo! Mail
Use Photomail to share photos without annoying attachments.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ms_access/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/