Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Option Group (2003)

    I have a combo box and a option group on a form. Based on the selection in the combo box, the option group can be hidden/displayed. The problem I have is that whatever the result, it's the same for all records. This is the code I have in the AfterUpdate property of the Test Type

    Private Sub TEST_TYPE_AfterUpdate()
    If Me.TEST_TYPE = "Analytical" Then
    Me.Cast.Visible = True
    Me.HT_Release_Note_No.Visible = False
    Me.Condition.Visible = False
    Else
    Me.Cast.Visible = False
    Me.HT_Release_Note_No.Visible = True
    Me.Condition.Visible = True
    End If

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Option Group (2003)

    Since you state "it's the same for all records" I assume that the form is a continuous form. A continuous form contains only a single set of controls used to display multiple records. If you make a control invisible, it will be invisible in all records.
    You could use Conditional Formatting instead of code to disable controls depending on the expression [Test_Type]="Analytical" (for Cast) or [Test_Type]<>"Analytical" (for HT_Release).
    Conditional formatting works at the record level, so it can be used in a continuous form. The disabled controls will still be visible, but grayed out, giving the user a clear visual signal.

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Option Group (2003)

    For some reason, I can't set Conditional Formatting for the Option Group. The option is greyed out on the Format menu.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Option Group (2003)

    Correct - it only works for text boxes and combo boxes. Perhaps you can use a combo box instead of an option group?

  5. #5
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Option Group (2003)

    Changed the option groups as you suggested, but I want to set different conditions for each combo box, but both seems to react to the same condition. I want to disable one if Test Type, is Analytical, and the other if it is Mechanical. There are three combo boxes in all that I need to hide under different conditions.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Option Group (2003)

    You can set a different condition for each combo box.

  7. #7
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Option Group (2003)

    I clicked on each combo box seperately, and even entered a second condition, but both react to the first.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Option Group (2003)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  9. #9
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Option Group (2003)

    Thanks Hans, sorted. Don't know why it wouldn't work yesterday, but I went into the database again today and did as you suggest, and everythings ok. Thanks again. Combo boxes do seem the best solution (and easiest) if you want to enable/disable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •