View Full Version : SubReport HasData Problem
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.
m0use 08-23-2004, 02:49 AM 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
m0use 08-23-2004, 03:06 AM 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... :(
=IIf([NewStockMonthTotal].[Report].[HasData],1,0)
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:
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]
You think I haven't tried that? :D
:confused:
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.
post a 97ver of your db here
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...
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.
whoops... didnt notice the link thingy...
it worked for me when I tested it... but it was because I was logged in to the file upload thing
open the page http://www14.brinkster.com/jv2jv2/ then open http://www14.brinkster.com/jv2jv2/stationeryDB.zip in another window :) hehehe sorry... cant be bothered to do a page with a link right now :o
please please please somebody come up with a nice workaround for this issue... Im dying here!!!!
C'mon Rich... Been looking at your posts elsewhere... You're a smart cookie... I know you can do it :)
Aside from not being able to figure out what does what in your db I can't see anything wrong with the HasData on your Report.
It would appear to be returning 1
haha... yeah Im sure it's a bit of a mess.. but it does what it's supposed to do... :)
but hmm... so it returns a value for you... very interesting... so in other words there doesnt seem to be anything wrong with it if opened in a newer version of access... but here Im still getting #name? which is really bugging me, since I have used the HasData method before and had it working fine...
|