Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual Basic code make text box visible or not visible

Posted on 2013-01-29
4
Medium Priority
?
910 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

604 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