Problem with report

  • Thread starter Thread starter Joan
  • Start date Start date
J

Joan

Hi,

I get a run-time error when I run the report, rptInvoiceStatement, that
states: "
Run-time error '2455: You entered an expression that has an invalid
reference to the property Form/Report." When I debugg, the following line
is highlighted: adj= nnz(me![rptInvoiceAdjustments].Report!txtAdjTot) = 0.

Nnz is a user defined function that checks to see if a sub-report's total is
a number, ( that there are in fact any records in the subreport).Following
is the code that the line above is in:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' See if there is any data in the InvoiceAdjustments subreport. If there
is, show the total textbox and it's label on the main report. If it isn't,
only the Pay textbox and accompaning label are shown.
Dim adj As Boolean
adj = nnz(Me![InvoiceAdjustments].Report!txtAdjTot) = 0
If adj Then
Me!Line135.Visible = False
Me!lblTotal.Visible = False
Me!txtTotal.Visible = False
Else
Me!Line135.Visible = True
Me!lblTotal.Visible = True
Me!txtTotal.Visible = True
End If
End Sub

An invoice statement with adjustments would have a "Total" textbox which
totals the other two subreports and a "Pay" textbox which totals all three
subreports. An invoice statement without adjustments should only have a
"Pay" textbox and label.

I don't get this message on my machine at home when I link to sample data in
a different back-end database. But when I use the client's back-end
database data on my machine, I get the same run-time error. What could this
possibly mean?

Joan
 
You have 2 equal signs. Should the later have been a comma inside the
quotes

From adj= nnz(me![rptInvoiceAdjustments].Report!txtAdjTot) = 0
To adj= nnz(me![rptInvoiceAdjustments].Report!txtAdjTot,0)

Kelvin
 
Kelvin,

I got it figured out finally. The problem was in my
client's tables. Where as my tables(sample data) had all
the fields filled in, my client's tables did not have
some of the join fields filled in. I fixed this in the
queries that make up the record source for the report, by
changing some of the joins to outer joins. Then the
record will be included, even when not all join fields
are filled in.

Thanks for your reply.

Joan
-----Original Message-----
You have 2 equal signs. Should the later have been a comma inside the
quotes

From adj= nnz(me![rptInvoiceAdjustments].Report! txtAdjTot) = 0
To adj= nnz(me![rptInvoiceAdjustments].Report! txtAdjTot,0)

Kelvin

Joan said:
Hi,

I get a run-time error when I run the report, rptInvoiceStatement, that
states: "
Run-time error '2455: You entered an expression that has an invalid
reference to the property Form/Report." When I
debugg, the following
line
is highlighted: adj= nnz(me!
[rptInvoiceAdjustments].Report!txtAdjTot) =
0.
Nnz is a user defined function that checks to see if a
sub-report's total
is
a number, ( that there are in fact any records in the subreport).Following
is the code that the line above is in:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' See if there is any data in the InvoiceAdjustments subreport. If there
is, show the total textbox and it's label on the main
report. If it
isn't,
only the Pay textbox and accompaning label are shown.
Dim adj As Boolean
adj = nnz(Me![InvoiceAdjustments].Report!txtAdjTot) = 0
If adj Then
Me!Line135.Visible = False
Me!lblTotal.Visible = False
Me!txtTotal.Visible = False
Else
Me!Line135.Visible = True
Me!lblTotal.Visible = True
Me!txtTotal.Visible = True
End If
End Sub

An invoice statement with adjustments would have a "Total" textbox which
totals the other two subreports and a "Pay" textbox which totals all three
subreports. An invoice statement without adjustments should only have a
"Pay" textbox and label.

I don't get this message on my machine at home when I
link to sample data
in
a different back-end database. But when I use the client's back-end
database data on my machine, I get the same run-time
error. What could
this
possibly mean?

Joan


.
 
What is the line adj= nnz(me![rptInvoiceAdjustments].Report!txtAdjTot) = 0
doing? I still see 2 equal signs. Are you doing a boolean evaluation of
nnz() to 0 and setting adj to True/False? Otherwise, I don't see why there
are 2 equal signs.

Kelvin

Joan said:
Kelvin,

I got it figured out finally. The problem was in my
client's tables. Where as my tables(sample data) had all
the fields filled in, my client's tables did not have
some of the join fields filled in. I fixed this in the
queries that make up the record source for the report, by
changing some of the joins to outer joins. Then the
record will be included, even when not all join fields
are filled in.

Thanks for your reply.

Joan
-----Original Message-----
You have 2 equal signs. Should the later have been a comma inside the
quotes

From adj= nnz(me![rptInvoiceAdjustments].Report! txtAdjTot) = 0
To adj= nnz(me![rptInvoiceAdjustments].Report! txtAdjTot,0)

Kelvin

Joan said:
Hi,

I get a run-time error when I run the report, rptInvoiceStatement, that
states: "
Run-time error '2455: You entered an expression that has an invalid
reference to the property Form/Report." When I
debugg, the following
line
is highlighted: adj= nnz(me!
[rptInvoiceAdjustments].Report!txtAdjTot) =
0.
Nnz is a user defined function that checks to see if a
sub-report's total
is
a number, ( that there are in fact any records in the subreport).Following
is the code that the line above is in:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' See if there is any data in the InvoiceAdjustments subreport. If there
is, show the total textbox and it's label on the main
report. If it
isn't,
only the Pay textbox and accompaning label are shown.
Dim adj As Boolean
adj = nnz(Me![InvoiceAdjustments].Report!txtAdjTot) = 0
If adj Then
Me!Line135.Visible = False
Me!lblTotal.Visible = False
Me!txtTotal.Visible = False
Else
Me!Line135.Visible = True
Me!lblTotal.Visible = True
Me!txtTotal.Visible = True
End If
End Sub

An invoice statement with adjustments would have a "Total" textbox which
totals the other two subreports and a "Pay" textbox which totals all three
subreports. An invoice statement without adjustments should only have a
"Pay" textbox and label.

I don't get this message on my machine at home when I
link to sample data
in
a different back-end database. But when I use the client's back-end
database data on my machine, I get the same run-time
error. What could
this
possibly mean?

Joan


.
 
Kelvin,
You are correct. adj is a variable of type Boolean. I am checking to see
if nnz() = 0 is True or False. nnz is a public function that takes the value
passed to it and checks to see whether it is a number. If it is not a
number, nnz() is set equal to 0. If it is a number, nnz() is set equal to
the value passed to it. If it isn't a number, I don't want certain controls
to not appear on the report. But if it is a number, then these controls
need to appear on the report. Hope this explains why there are two equal
signs.

Joan




Kelvin said:
What is the line adj= nnz(me![rptInvoiceAdjustments].Report!txtAdjTot) = 0
doing? I still see 2 equal signs. Are you doing a boolean evaluation of
nnz() to 0 and setting adj to True/False? Otherwise, I don't see why there
are 2 equal signs.

Kelvin

Joan said:
Kelvin,

I got it figured out finally. The problem was in my
client's tables. Where as my tables(sample data) had all
the fields filled in, my client's tables did not have
some of the join fields filled in. I fixed this in the
queries that make up the record source for the report, by
changing some of the joins to outer joins. Then the
record will be included, even when not all join fields
are filled in.

Thanks for your reply.

Joan
-----Original Message-----
You have 2 equal signs. Should the later have been a comma inside the
quotes

From adj= nnz(me![rptInvoiceAdjustments].Report! txtAdjTot) = 0
To adj= nnz(me![rptInvoiceAdjustments].Report! txtAdjTot,0)

Kelvin

Hi,

I get a run-time error when I run the report, rptInvoiceStatement, that
states: "
Run-time error '2455: You entered an expression that has an invalid
reference to the property Form/Report." When I debugg, the following
line
is highlighted: adj= nnz(me!
[rptInvoiceAdjustments].Report!txtAdjTot) =
0.

Nnz is a user defined function that checks to see if a sub-report's total
is
a number, ( that there are in fact any records in the subreport).Following
is the code that the line above is in:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' See if there is any data in the InvoiceAdjustments subreport. If there
is, show the total textbox and it's label on the main report. If it
isn't,
only the Pay textbox and accompaning label are shown.
Dim adj As Boolean
adj = nnz(Me![InvoiceAdjustments].Report!txtAdjTot) = 0
If adj Then
Me!Line135.Visible = False
Me!lblTotal.Visible = False
Me!txtTotal.Visible = False
Else
Me!Line135.Visible = True
Me!lblTotal.Visible = True
Me!txtTotal.Visible = True
End If
End Sub

An invoice statement with adjustments would have a "Total" textbox which
totals the other two subreports and a "Pay" textbox which totals all three
subreports. An invoice statement without adjustments should only have a
"Pay" textbox and label.

I don't get this message on my machine at home when I link to sample data
in
a different back-end database. But when I use the client's back-end
database data on my machine, I get the same run-time error. What could
this
possibly mean?

Joan




.
 
Back
Top