When no data in subreport (1 Viewer)

asp_learner

Registered User.
Local time
Today, 17:11
Joined
Jun 7, 2001
Messages
46
Hi,

I was really trying to do this on my own but I can't get this to work.

I have code in the subreport where if there is no data I can make a label visible. when I run the subreport alone the code works.

I can't get this to work from the main report.

Basically I am trying to write code if the subreport is null or has no data, a label on the main report will become visible.

Thanks,
Eva
 
R

Rich

Guest
Use the HasData method, there should be an example in the help.
HTH
 

asp_learner

Registered User.
Local time
Today, 17:11
Joined
Jun 7, 2001
Messages
46
Hi Rich,

I still can get the HasData Property to work. I tried writing the code several ways but the label still stays invisible. What event should I put the code in.

This is one way I wrote the code:

If Me![SubKnownLosses].Report.HasData = 0 Then
LbLNoData.Visible = True
Else
LbLNoData.Visible = False
End If

I also want to thank you for all the help you have given me so far. I've learned a lot from you, Pat and the pros.

Eva
 

asp_learner

Registered User.
Local time
Today, 17:11
Joined
Jun 7, 2001
Messages
46
Rich,

I tried it in both the group footer where the label is and in the main report. I tried it in all different events.

Eva
 
R

Rich

Guest
Sorry been brain dead all week, change the label to a text box, set control source to
=IIf([SubKnownLosses].[Report].[HasData],"Your label Text","")
 

asp_learner

Registered User.
Local time
Today, 17:11
Joined
Jun 7, 2001
Messages
46
Thank you.

Wow I am the one that is brain dead. I didn't think of that. I hope this experience will help make me understand programming better.

Have a great day
Eva

[This message has been edited by asp_learner (edited 01-25-2002).]
 

Users who are viewing this thread

Top Bottom