Report subform

  • Thread starter Thread starter chad
  • Start date Start date
C

chad

I am using the following funcion in
the OnFormat() event procedure of my main report in the
details section where my subreport is located.

Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)

If Forms!zzzzzz!txtChkPricing = -1 Then
Reports!rptquote.Report!SubQuote.Report!
jd_ExtendedPrice.Visible = False
End If
End Sub

Basically, if the check box on the referenced form = -1
then I want the specified control on my subform not to
show.

When the check box is -1 then I receive the following
error: "You entered an expression that has an invalid
reference to the property Form/Report" If it equals 0
then the report opens blank.

The following piece of code works fine becaue if I
tested that 1 line in the event procedure and it will
always turn off the visible property of the specified
control.
Reports!
rptquote.ReportSubQuote.Reportjd_ExtendedPrice.Visible =
False

I don't fully understand how to string together a call to
a report control or form control. I get confused as to
when to use a period or exclamation mark.

Can somoene maybe explain that and also tell me if I am
referencing my form correctly.

Thanks!
 
Chad:

It may be in your syntax for referencing the sub report's control why not
simply:

Me!SubQuote.Report!jd_ExtendedPrice.Visible = False
 
That part of the code works fine. It's when I try to use
the IF statment to place a condition on wheater I want to
view the column or not.
 
Back
Top