Solved

Hide / Unhide Fields

Posted on 2007-11-22
4
171 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
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…

821 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