Results 1 to 8 of 8
  1. #1
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155

    Visibility of other controls

    Sometimes you want to control the visibility (or other property) of one control to be based on the value in another.



    I have "Option 42" which is a Y/N selection.
    I also have "Label 48" which I want to become active only if Option 42 is Yes.

    What is the best thing to do in this situation? Any suggestions?

    J
    Last edited by jlclark4; 12-15-2010 at 12:34 PM.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    in the option42's event:
    private sub Option42_click()
    label48.visible=option42
    end sub

  3. #3
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I cant get it to work, even played with the numbers some. Let me know sure It's still the same.

    "Complaint?" = Label 40
    "No" = Option42
    "Yes" = Option 44

    "Compliance" = Label 48
    Drop Down of types = Type of Complaint

    So to get the Compliance/Type of Complaint to become active when the Yes button is clicked
    In option44's event:
    private sub Option44_click()
    label48.visible=Option44
    end sub

    Is that correct? If so, maybe I am misunderstanding where the placement should be. (see attached jpeg)

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    are option42 and option44 in a option group box so that only one of them can be selected?
    in this case, the option44_click event won't trigger when click.
    you need to put codes in the frame1_beforeUpdate(), and please set the value of option42 to 0, value of option44=-1

    Private Sub Frame17_BeforeUpdate(Cancel As Integer)
    label48.visible=frame17
    End Sub

  5. #5
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Yes. They are in "Frame39". I will try what you just sent me.

  6. #6
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    Okay, That worked. Now is it possible by doing the same thing, to have the drop down that goes with the Label48 to appear only when Yes is selected as well?

  7. #7
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    do forget to set the value of option42 to 0, value of option44=-1

  8. #8
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155
    I figured it out. I changed Label48 to TypeOfComplaint within the code you sent me. Thank you so much for your help weekend00!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Tab Controls
    By karlhardeman in forum Forms
    Replies: 10
    Last Post: 08-25-2010, 07:01 AM
  2. Help with calculated controls
    By DannyV in forum Forms
    Replies: 2
    Last Post: 04-20-2010, 12:07 PM
  3. Controls don't work on subforms
    By rscott7706 in forum Forms
    Replies: 8
    Last Post: 03-07-2010, 10:17 PM
  4. calendar controls
    By kganomega in forum Access
    Replies: 0
    Last Post: 12-16-2009, 12:34 PM
  5. Replies: 0
    Last Post: 11-24-2009, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums