Thank you for looking in to it again.
Unfortunatly it did not help this time either.
The reffering part must be right now as it calculates
right when there is a value. There is only an error when
the subreport value is null.
The function righ now is as follows:
"Function Subtotals() As Currency
Subtotals = Nz(Reports!Köpredovisning!NettoprisSubtotal,
0) - Nz((Reports!Köpredovisning!
Köpredovisning1TjänsterSubreport.Report!
NettoprisSubtotal2), 0)
End Function"
Regards
Mattias
>-----Original Message-----
>On Wed, 3 Oct 2001 03:39:28 -0700, "Mattias Schlipp"
><info...@home.sol.se> wrote:
>
>Jumping in again, and looking more closely, it seems
you're referring
>to a control on a Subreport. You cannot do so directly;
you must go
>through the Main report, the Subreport control's Report
property, and
>then to the control. Try:
>
>>Hello Terry
>>
>>I putting this in the controls controlsource, still
>>getting invalid syntax and not being able to save it in
to
>>the control.....-
>>--
>>Mattias
>>>-----Original Message-----
>>>Try
>>>
>>>=nz([NettoprisSubtotal],0)-nz
>>((KöpredovisningTjänsterSubreport!NettoprisSubt
>>>otal2),0)
>>>
>
>nz((Reports!MainReportName!
KöpredovisningTjänsterSubreport.Report!
NettoprisSubtotal2),0)
>
> John W. Vinson[MVP]
> Come for live chats every Tuesday and Thursday
>http://go.compuserve.com/msdevapps?loc=us&access=public
>.
>
.
Forms![Orders]![Orders Subform]![Quantity]
The full identifier for the Quantity control would be:
Forms![Orders]![Orders Subform].Form![Quantity]
Also from HELP:
If the value of the variant argument is Null, the Nz function returns the
number zero or a zero-length string, depending on whether the context
indicates the value should be a number or a string.
Try changing
Nz((Reports!Köpredovisning!Köpredovisning1TjänsterSubreport.Report!Nettopris
Subtotal2), 0)
to
Nz(Reports![Köpredovisning]![Köpredovisning1TjänsterSubreport]![NettoprisSub
total2]))
HTH
Mich
Mattias Schlipp <info...@home.sol.se> wrote in message
news:577601c14ceb$dd1b6470$39ef2ecf@TKMSFTNGXA08...
Have tried what you suggested but still get the same error.
The function look like this now:
"Function Subtotals() As Currency
Subtotals = Nz(Reports!Köpredovisning!NettoprisSubtotal,
0) - Nz(Reports![Köpredovisning]!
[Köpredovisning1TjänsterSubreport]![NettoprisSubtotal2])
End Function"
Regards
Mattias
>..
>
>
>
>
>.
>
'***************** Code Start ***************
'This code was originally written by Keri Hardwick.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
'Code Courtesy of
'Keri Hardwick
'
Function nnz(testvalue As Variant) As Variant
'Not Numeric return zero
If Not (IsNumeric(testvalue)) Then
nnz = 0
Else
nnz = testvalue
End If
End Function
'***************** Code End ****************
So, after putting the above function in a standard module, your change the
reference in your report from this:
Nz(Reports!Köpredovisning!Köpredovisning1TjänsterSubreport.Report!NettoprisS
ubtotal2, 0)
to this:
nnz(Reports!Köpredovisning!Köpredovisning1TjänsterSubreport.Report!Nettopris
Subtotal2)
--
Dirk Goldgar
www.datagnostics.com
(to reply via e-mail, remove NOSPAM from address)
"Mattias Schlipp" <info...@home.sol.se> wrote in message
news:577601c14ceb$dd1b6470$39ef2ecf@TKMSFTNGXA08...
The nnz function made it work..finally. Thank you all
very much for the assistance.
Regards,
Mattias
>..
>
>
>
>
>.
>
The nnz function made it work..finally. Thank you all
very much for the assistance.
Regards,
Mattias
>Nz(Reports!Köpredovisning!
Köpredovisning1TjänsterSubreport.Report!NettoprisS
>ubtotal2, 0)
>
>to this:
>
>
>
>nnz(Reports!Köpredovisning!
Köpredovisning1TjänsterSubreport.Report!Nettopris
>..
>
>
>
>
>.
>