Solved

Hide / Unhide Fields

Posted on 2007-11-22
4
173 Views
Last Modified: 2013-11-28
Hi All,

I have a checkbox named 'Check72'
When that is ticked I would like the following fields to be visible:

Label63, Label67, Lable71, txtMinor1, txtMinor2, txtMinor3, txtModerate1, txtModerate2, txtModerate3, txtMajor1, txtMajor2, txtMajor3, Text36, Text38 and Text39

Does anyone know how i'd make this possible?
Many Thanks,

Pete
0
Comment
Question by:PeterHing
[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
4 Comments
 
LVL 48

Accepted Solution

by:
jpaulino earned 100 total points
ID: 20334026
You can do

If Check72.Value = 0 Then
 ' hide fields like Label63.Visible = False
Else
 ' show fields like Label63.Visible = True
End If
0
 
LVL 46

Assisted Solution

by:tbsgadi
tbsgadi earned 100 total points
ID: 20334082
Hi PeterHing,

Label63.visible=Check72
Label67.visible=Check72
etc

Good Luck!

Gary
0
 
LVL 34

Assisted Solution

by:jefftwilley
jefftwilley earned 25 total points
ID: 20334497
tbsgadi has the right idea.

Create a public sub in your form's code module and put all the labels there as Gary has stated.

Public Sub UpdateLabels()

Label63.visible=Check72
Label67.visible=Check72
etc..
end sub


Then in the after update event of your checkbox, put a call to the UpdateLabels code

Private Sub MyCheckAfter_Update()
call UpdateLabels
end sub

Then you also want to put that same call in your form_Open event.

That way, you keep from having to do the same code twice.

Luck!
J
0
 
LVL 13

Assisted Solution

by:wiswalld
wiswalld earned 25 total points
ID: 20334868
If Me.Check72 = True Then
Me.Label67.visible = True
Me.Label63.Visible = True
Etc
Else
Me.Label63.Visible = False
Etc.
End If
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

623 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