SubReport HasData Problem

jv2

Registered User.
Local time
Today, 23:44
Joined
Aug 9, 2004
Messages
34
Hello all!!

I have been trying to get this to work for a while now... but I just cant work out what is going wrong... I have used the HasData property successfully before, but no luck now.

I have a sub report "Report.NewStockMonthTotal" with the Name "NewStock". To do the calculations correctly for months that do not have any new incoming stock I need to use an IIF. I tried using an IIF in the calculation field... but it just isn't working...

Now I've stepped back a few steps and just created a textbox with a controlsource of "=IIf([NewStock].[Report].[HasData]=True,1,0)" but even this just gives me "#name?" on the report...

What is going on? Any ideas?
Your help is much appreciated.

Thanks!

J.
 
Jv2 try the following: =IIf([Reports].[....].[HasData] etc...

Greetz, m0use
 
I have tried
=IIf([Reports]![NewStockMonthTotal].[HasData],1,0)
and several variations of this... but they all give me the #name? error
 
Have you tried: =IIf([Reports]![NewStockMonthTotal].[HasData]=False,1,0)...?

This seems to work for me!

m0use
 
Yup... have tried this...
and this format worked fine before when I tried it elsewhere...
but in this report it always gives me the #name? error :mad:

any more suggestions? :confused:
 
This is still doing my head in... :mad:

If you guys have any suggestions for a workaround... I would be more than happy to try anything... :)

I've also tried using an IIF in the subform so that the sums textbox displays 0 if the fields to be summed are null. this works correctly on the subform... but when I use that sum reference in the main form... it still gives me #error.

HELP!!! :)
 
Your syntax is almost certainly incorrect, use the Code builder to get the correct References to your subReport and control
 
Rich,
Which one of the syntaxes were you referring to? I have tried so many different ways of doing it... obviously starting with what I though was the correct way...
I have also tried using the the expression builder... but it's no help.
Besides... I cantr find the HasData property on the expression builder... :(
 
Using this just causes the report to ask me for a value for the NewStockMonthTotal variable.

Report is called "NewStockMonthTotal" - The subform control is named "NewStock"

any more suggestions? :)

Please? :rolleyes:
 
jv2 said:
Using this just causes the report to ask me for a value for the NewStockMonthTotal variable.

Report is called "NewStockMonthTotal" - The subform control is named "NewStock"

any more suggestions? :)

Please? :rolleyes:

Then it's just [NewStock] instead of [NewStockMonthTotal]
 
It's the name of the subReport as it appears on the main report Property sheet, not the name in the DB Window
 
as far as I know... the main report property sheet does not refer to the subreport...
right clicking on the subreport control and selecting the properties shows me:
name: NewStock
SourceObject: Report.NewStockMonthTotal
I have tried several methods of referring to this £%^"$% report and it's just having none of it... :mad:
 
Open the main report in design view, open the property sheet, click the subReport control, click the Other tab on the property sheet, the Name you need is there
 
It has not changed since the first post :) it is still "NewStock"
and it does not work with any of these references. :(
Any ideas on what is causing this?
Or what I could do to work around this problem?

Cheers.
 
wouldn't I just be so happy if I could do that... I'm stuck with Access 2.0 :mad:
and I would attach that here If I could... it says file size limit for zip 100k... even tried stripping some stuff out from it :) but no help... you can now find it at http://www14.brinkster.com/jv2jv2/stationeryDB.zip
Think you should be able to view it... if you go to reporting and select either january or february... and then click on the top left report (monthly something) you will find that there is a test box on the left which gives the #name? error... also... if you select "March" and then run the report... all the sums give errors... that is the reason Im trying to get this to work... as if there is no "newStock" deliveries in a particular month... then the calculations f*up...
 
Last edited:
Access 2.0, isn't that Access95? if it is then I'm not sure that the HasData method was available.

Your link doesn't work :confused:
 
I think it is an earlier version..not 95... think it came out either 93 or 94... too old anyway :)
I have now built 4 databases in it... and have used the HasData successfully elsewhere.
 

Users who are viewing this thread

Back
Top Bottom