visible control property

B

brian

Hello,

I posted a similiar question a few days ago but am still
having problems with it.

I have a form 'zzzzzz' that calls a report. The report
contains a subreport. I want a data columns visible
property to be turned on or off based on the
control 'chkbox' from the form.

Names of the forms/reports are as follows:
Form- zzzzzz
Subreport- subrptQuote
Report- rptQuote

I am currently trying the following and it doesn't work.
The on open event procedure is triggered when the main
report is opened.

Private Sub Report_Open(Cancel As Integer)
If Forms![zzzzzz]![chkPricing] = 1 Then
Me.[subrptQuote]!Reports![jd_ExtendedPrice].Visible =
False
End If
End Sub

chkPricing is a check box with a value = to 1 or 0

Thank You
 
B

brian

Thanks for the advice John

Here is an update to my problem: I am using the following funcion in
the OnFormat() event procedure of my main report.

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 only use that 1
line in the event procedure it will always turn off the visible
property of the specified control.
Reports!rptquote.Report!SubQuote.Report!jd_ExtendedPrice.Visible =
False

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

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

Thanks!


John Spencer (MVP) said:
Try testing for TRUE. In Access, the value of True is negative 1.

If Forms![zzzzzz]![chkPricing] = True Then
...

By the way, it helps if you describe the problem a little better than "... it
doesn't work...". That could mean anything from no results, wrong results,
error messages, the application halts, the application crashes.

I'm making the guess that you meant that the subreport control on the report is
not being hidden, but I could be wrong.
Hello,

I posted a similiar question a few days ago but am still
having problems with it.

I have a form 'zzzzzz' that calls a report. The report
contains a subreport. I want a data columns visible
property to be turned on or off based on the
control 'chkbox' from the form.

Names of the forms/reports are as follows:
Form- zzzzzz
Subreport- subrptQuote
Report- rptQuote

I am currently trying the following and it doesn't work.
The on open event procedure is triggered when the main
report is opened.

Private Sub Report_Open(Cancel As Integer)
If Forms![zzzzzz]![chkPricing] = 1 Then
Me.[subrptQuote]!Reports![jd_ExtendedPrice].Visible =
False
End If
End Sub

chkPricing is a check box with a value = to 1 or 0

Thank You
 
J

John Spencer (MVP)

That looks as if it should work AS LONG AS the Form named "zzzzzz" is open and
has a control on it named txtChkPricing. Is the FORM open? Does it have that
control?

Have you tried tracing the code to see which line causes the error?
Thanks for the advice John

Here is an update to my problem: I am using the following funcion in
the OnFormat() event procedure of my main report.

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 only use that 1
line in the event procedure it will always turn off the visible
property of the specified control.
Reports!rptquote.Report!SubQuote.Report!jd_ExtendedPrice.Visible =
False

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

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

Thanks!

John Spencer (MVP) said:
Try testing for TRUE. In Access, the value of True is negative 1.

If Forms![zzzzzz]![chkPricing] = True Then
...

By the way, it helps if you describe the problem a little better than "... it
doesn't work...". That could mean anything from no results, wrong results,
error messages, the application halts, the application crashes.

I'm making the guess that you meant that the subreport control on the report is
not being hidden, but I could be wrong.
Hello,

I posted a similiar question a few days ago but am still
having problems with it.

I have a form 'zzzzzz' that calls a report. The report
contains a subreport. I want a data columns visible
property to be turned on or off based on the
control 'chkbox' from the form.

Names of the forms/reports are as follows:
Form- zzzzzz
Subreport- subrptQuote
Report- rptQuote

I am currently trying the following and it doesn't work.
The on open event procedure is triggered when the main
report is opened.

Private Sub Report_Open(Cancel As Integer)
If Forms![zzzzzz]![chkPricing] = 1 Then
Me.[subrptQuote]!Reports![jd_ExtendedPrice].Visible =
False
End If
End Sub

chkPricing is a check box with a value = to 1 or 0

Thank You
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top