469,159 Members | 1,518 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,159 developers. It's quick & easy.

How do I display additional hidden choices when a selection is made?

5
I am creating a form for users to submit computer acess. I have several choices for them to choose, however depending on the choice there are hidden options that I want to have display for them to choose from too. In the property sheet I have those lables hidden so that they don't display on the main form. How to I get them to display when a primary choice is made?
Sep 30 '11 #1
10 1229
patjones
931 Expert 512MB
This is something that you need to use a little bit of VBA code for. What kind of control are you using for the choices? (e.g. option group, combo box, etc.)

Pat
Sep 30 '11 #2
dap6c6
5
Thanks..I am using a check box control.
Sep 30 '11 #3
patjones
931 Expert 512MB
OK, speaking generally, suppose you have a check box called chk and a label called lbl. In the On Click event for the check box, this code will achieve what you're looking for:

Expand|Select|Wrap|Line Numbers
  1. Private Sub chk_Click()
  2.  
  3. Me.lbl.Visible = Me.chk
  4.  
  5. End Sub

The Visible property for a label can be either TRUE or FALSE, and the check box status of checked or unchecked corresponds to these boolean values respectively.

Pat
Sep 30 '11 #4
dap6c6
5
I'm sorry but that didn't work for me...
Sep 30 '11 #5
patjones
931 Expert 512MB
Can you post the code that you used?
Sep 30 '11 #6
dap6c6
5
Expand|Select|Wrap|Line Numbers
  1. Private Sub Check48_Click()
  2.  
  3. Me.Check73.Visible = Me.Check48
  4. Me.Lable74.Visible = Me.Check48
  5.  
  6. End Sub
Sep 30 '11 #7
NeoPa
32,167 Expert Mod 16PB
I would suggest the AfterUpdate event might be a more reliable one to use. Otherwise I have no idea what the question is about. I'm assuming Pat does. If not, remember it's easier to deal with questions that don't make sense by reporting them for clear-up.
Sep 30 '11 #8
patjones
931 Expert 512MB
Is your control name really "Lable74" or is it "Label74"? Also make sure that you compiled and saved the code prior to returning to the form and trying it.

You can also try AfterUpdate as NeoPa suggests; however, I did test this in my sandbox database and found that it works. So I'm not sure off the top of my head what else could be the issue.
Sep 30 '11 #9
patjones
931 Expert 512MB
Did we resolve the first issue for you? If so I would suggest a new thread for this question as it is not related to the original topic. Thanks.
Oct 4 '11 #10
dap6c6
5
Yes, thank you I had a typo...
Oct 4 '11 #11

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

33 posts views Thread by Nigel Molesworth | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.