Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 917
  • Last Modified:

Visual Basic code make text box visible or not visible

I have two text fields on my access report. If the RUNSUM has a number greater than 3, then I need to have CLSHOW not visible.

I wrote this in the code, but it does not seem to be working

Private Sub IiF()
If Me.RUNSUM > 3 Then
Me.CLSHOW.Visible = False
Else
Me.CLSHOW.Visible = True
End If
End Sub

What am I doing wrong?
0
joylene6
Asked:
joylene6
  • 2
1 Solution
 
als315Commented:
Where you call function? It should be in On Format event. Result will be visible only in print or print preview, not in report view.
0
 
IrogSintaCommented:
You should be using the OnFormat event of one of the sections in your report such as the Detail section:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.CLSHOW.Visible  = (Me.RUNSUM <= 3)
End Sub

Open in new window

0
 
joylene6Author Commented:
That worked!! thanks
0
 
joylene6Author Commented:
Thanks you
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now