Help with setting a label to Visible

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmurphmsu
    New Member
    • Nov 2006
    • 19

    Help with setting a label to Visible

    I have an access data base we use to create reminder letters for our dr's patients. The patients appts are imported into access, a query ran on the data and report is used to make the actual letter. I want to add a custom txt box or label for one of the dr's but want to do it based on the dr's name. Here is the code i have:

    If (Me.RESC_NAME = "Dr name taken out for security purpose") Then
    Me.txtTurner.Pr operties.Visibl e = True
    Else
    Me.txtTurner.Pr operties.Visibl e = False
    End If

    if I just do me. to see what options i get, the txtTurner is not in the list but other text boxes and labels are. Any ideas?
  • mmurphmsu
    New Member
    • Nov 2006
    • 19

    #2
    I have also tried this on a click event:

    If (Me.RESC_NAME = "Dr name") Then
    Report_CNT.txtT urner.Propertie s.Application.V isible = True
    Else
    Report_CNT.txtT urner.Propertie s.Application.V isible = False
    End If

    and that didn't work either.

    Comment

    • ChipR
      Recognized Expert Top Contributor
      • Jul 2008
      • 1289

      #3
      It looks like you want to use iif in the field definition
      IIf(expr, truepart, falsepart)
      so iif("DrName = ""Whatever" "", replacement, DrName)
      and the replacement can just be "" if you want.
      Chip

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        Your basic syntax is incorrect.

        Me.txtTurner.Pr operties.Visibl e = True

        should simply be

        Me.txtTurner.Vi sible = True

        Welcome to Bytes!

        Linq ;0)>

        Comment

        • mmurphmsu
          New Member
          • Nov 2006
          • 19

          #5
          ChipR: That did the trick. I very much appreciate your help. I spent all most all day yesterday trying to get this to work.

          Comment

          Working...