Solved

Visual Basic code make text box visible or not visible

Posted on 2013-01-29
4
886 Views
Last Modified: 2013-01-30
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
Comment
Question by:joylene6
  • 2
4 Comments
 
LVL 39

Expert Comment

by:als315
ID: 38833873
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
 
LVL 29

Accepted Solution

by:
IrogSinta earned 500 total points
ID: 38833896
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
 
LVL 1

Author Comment

by:joylene6
ID: 38835424
That worked!! thanks
0
 
LVL 1

Author Closing Comment

by:joylene6
ID: 38835428
Thanks you
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now