Hide textbox on parent

C

CJ

Hi Groupies

I used the On No Data event on my subreport so that if it has no data, it
does not print. However, if the sub does not print, I also want two text
boxes on the main report to not be visible either.

I have entered the following code in every event that I can think of, with
no luck.

If Me.rsubReconcileOnGround.Report.Visible = False Then
Me.txtBoxesAfterRec.Visible = False

Any ideas?
 
D

Duane Hookom

I wouldn't use code. Try control sources like:
=IIf(subrptctl.Report.HasData,[previous control source],Null)
 
C

CJ

Hi Duane, thanks for the speedy response.

I was about to respond back with "Where do I enter the IIF
statement?".....then I had a thought.

I entered the following in the OnPrint event:

If Me.rsubReconcileOnGround.Report.HasData Then
Me.txtBoxesAfterRec.Visible = True
Else
Me.txtBoxesAfterRec.Visible = False
End If

Works perfectly!

Thanks for steering me in the right direction with the "HasData" property.
--
Thanks for the brainwaves!

CJ
--------------------
I blame the parents
Duane Hookom said:
I wouldn't use code. Try control sources like:
=IIf(subrptctl.Report.HasData,[previous control source],Null)
--
Duane Hookom
Microsoft Access MVP


CJ said:
Hi Groupies

I used the On No Data event on my subreport so that if it has no data, it
does not print. However, if the sub does not print, I also want two text
boxes on the main report to not be visible either.

I have entered the following code in every event that I can think of,
with
no luck.

If Me.rsubReconcileOnGround.Report.Visible = False Then
Me.txtBoxesAfterRec.Visible = False

Any ideas?
 

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