no data

kingsgambit

Registered User.
Local time
Today, 20:29
Joined
May 27, 2001
Messages
134
I have a form with subforms and I produce a report from them, I don't use sub-reports the report is based on a query. If one of the subforms is not used by the user it creates an error on the report because it can't calculate the total. I have seem people say about HasData but I can't find examples of where to put it, or Nz. What I need is if the sunform has not been selected then value equals one. Do I put this in thew query or the report and where
 
The HasData is on the event tab of the report, under On No Data.

From here you can control what you want to do, eg

Code:
Private Sub Report_NoData(Cancel As Integer)

    MsgBox "There are no records available for " & Forms!frmruncostincomereports.CbBusinessUnit.Column(1), _
     vbCritical + vbOKOnly, "No Records"
     
        DoCmd.CancelEvent
        Cancel = True

End Sub
 
There have been numerous examples posted here of using the HasData method, have you looked?
 
Yes, but each time I go to a post about HasData it says there are post here that explain this. I must not be looking in the right place?
 

Users who are viewing this thread

Back
Top Bottom