subreport calculated control #Name? error

MariaZ

New member
Local time
Today, 11:18
Joined
Feb 15, 2012
Messages
8
Please, help again!

There are several standalone reports, all with different Record Source.
I want to put them as subreports into Detail section of one unbound report.

One of them doesn't work as subreport: #Name? error in calculated control.

As standalone report rptPCDev:
Text Box
Name: txtDevice1
Control Source: =IIf(IsNull([tblPC.InvLabel]);"";nz(DLookUp("Description";"qryDevicesPC";"PC=" & Reports!rptPCDev!PCid);""))

As subreport: #Name?

Thank you...
 
try to put all your calculated field with the formula =IIf(IsNull([tblPC.InvLabel]);"";nz(DLookUp("Description";"qryDevicesPC";"PC =" & Reports!rptPCDev!PCid

in query of your subreport.

Note that any such control with formula will not work directly on the report. the better place to calculate all your fields is the query grid, where you can calculate all your fields and then use them on your report.
 
Thank you for advice. I'll try it and let you know results.
 
When you embed a report as a subreport, then it no longer exists as a report. Therefore your reference to the report in Reports!rptPCDev!PCid will be invalid.

Reports!NameOfYourMainReport.Report!rptPCDev!PCid should do the trick
 
When you embed a report as a subreport, then it no longer exists as a report. Therefore your reference to the report in Reports!rptPCDev!PCid will be invalid.
Right you are!

It's pointing to a field on the same report:
Code:
=IIf(IsNull([tblPC.InvLabel]); Null ;DLookUp("Description";"qryDevicesPC";"[URL="http://www.access-programmers.co.uk/forums/showthread.php?t=221923#"][COLOR=darkgreen]PC[/COLOR][/URL]  =" & [PCid]))
 
#6 Of course... I confused myself and thought this was in a query
 
of course the reference of report (Reports!rptPCDev!PCid) in the underline query will be invalid and will produce an error. sorry for not to notice the referred report in a hurry.
 
No problem. It's interesting that this last (short) part of expression doesn't work in forms so i had to use full name and in the report/subreport works.
Thank you anyway
 
It's interesting that this last (short) part of expression doesn't work in forms ...
It works. Just make sure the name of the field is not the same as the name of the control. For example, if your field is called ID, call the textbox txtID.
 

Users who are viewing this thread

Back
Top Bottom