Visibility again

  • Thread starter Thread starter CJ
  • Start date Start date
C

CJ

Hi again Groupies

Yesterday I posted a question regarding making one field invisible based on
the contents of another field. I would like the report to look like this:

Sum of Sum of
OT Hours PT Hours
Occupational Therapy 25
Physical Therapy 40

Unfortunately, both of my fields (SumOflngPufHrsOT and SumOflngPufHrsPT) are
now invisible all of the time. My code is below:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.strDeptName = "Physical Therapy" Then
Me.SumOflngPufHrsOT.Visible = False
Else
Me.SumOflngPufHrsPT.Visible = False
End If
End Sub

If I leave the Else portion out, then OT is invisible all of the time so
obviously, I am missing something.

Any thoughts?
Thanks
CJ
 
You need to set the visible property for each line of the detail. IF you
don't, once the value is set to false, it will stay false.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.strDeptName = "Physical Therapy" Then
Me.SumOflngPufHrsOT.Visible = False
Me.SumOflngPufHrsPT.Visible = True
Else
Me.SumOflngPufHrsPT.Visible = False
Me.SumOflngPufHrsOT.Visible = True
End If
End Sub
 

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

Similar Threads


Back
Top