?
Solved

Visual Basic code make text box visible or not visible

Posted on 2013-01-29
4
Medium Priority
?
906 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

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 2000 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

RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Suggested Courses

800 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