Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2006
    Location
    Washington, D.C
    Posts
    29

    Unanswered: Conditional formatting for option group

    Is there any way to apply conditional formatting for an option group? What I am trying to do is to disable one of the options if a certain condition is true. I am using a continuous form and when I try to do it for the on current event it makes all of them disabled and not just the one’s I want. Help!!!!

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by alaoa
    Is there any way to apply conditional formatting for an option group? What I am trying to do is to disable one of the options if a certain condition is true. I am using a continuous form and when I try to do it for the on current event it makes all of them disabled and not just the one’s I want. Help!!!!
    Hello again
    Are they unbound?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jan 2006
    Location
    Washington, D.C
    Posts
    29
    Dude you are my life saver. No they are not unbound. I basically have 3 choices Met, Not Met and NA. I want to make NA disabled if another field is true. If I need to make this unbound it will not be a problem.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by alaoa
    Dude you are my life saver. No they are not unbound. I basically have 3 choices Met, Not Met and NA. I want to make NA disabled if another field is true. If I need to make this unbound it will not be a problem.
    Nope. Sorry I misread.
    I don't tend to use option groups but I think the whole point of them is you treat them as a single control. One for all and all for one.

    You can simulate the affect by using some after update code which makes the others false if the one changes to true. If it changes to false thenset the top one true and the rest false. Then you can handle the disabling of one of them.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Feb 2006
    Location
    Houston, TX USA
    Posts
    16
    Alaoa -

    Access Conditional Formatting only formats the physical conttrol (forecolor, backcolor, etc), no the contrl value.

    You therefore have the set the option group value on the event of your choice. Maybe on the AfterUpdate event on some control.

  6. #6
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by alaoa
    Dude you are my life saver. No they are not unbound. I basically have 3 choices Met, Not Met and NA. I want to make NA disabled if another field is true. If I need to make this unbound it will not be a problem.
    Did you create them with the OptionBox tool? When you place them inside the OptionBox window to create it, it automatically deselects one when you choose another. If you created from scratch you simply have to code your choices. I created an OptionBox and then coded it like this:
    Code:
    Private Sub TypeOptions_AfterUpdate()
    
        If TypeOptions = 1 Then
            Me.Filter = "Type = 'Youth'"
            Me.FilterOn = True
        ElseIf TypeOptions = 2 Then
            Me.Filter = "Type = 'Elderly'"
            Me.FilterOn = True
        ElseIf TypeOptions = 3 Then
            Me.Filter = "Type = 'Animals'"
            Me.FilterOn = True
        ElseIf TypeOptions = 4 Then
            Me.Filter = "Type = 'SocSvc'"
            Me.FilterOn = True
        ElseIf TypeOptions = 5 Then
            Me.Filter = "Type = 'Work'"
            Me.FilterOn = True
        ElseIf TypeOptions = 6 Then
            Me.Filter = "Type = 'SpecEvents'"
        Else
            Me.FilterOn = False
          End If
        
        
    End Sub
    Give it a try, something like that. Also, you can use the Select Case statements which is actually much cleaner than many If Statements.

    have a nice one,
    BUD

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by pootle flump
    You can simulate the affect by using some after update code which makes the others false if the one changes to true. If it changes to false thenset the top one true and the rest false. Then you can handle the disabling of one of them.
    That doesn't make much sense does it?
    I meant you can pop several option buttons on a form and create after update code for each of them to simulate the action of an option group. They are distinct controls, and so can be enabled\ disabled, but change values depending on the selections of the other option controls.

    As it happens, this is the way I created this affect before I realised there was an option group control.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  8. #8
    Join Date
    Jan 2006
    Location
    Washington, D.C
    Posts
    29
    Quote Originally Posted by pootle flump
    That doesn't make much sense does it?
    I meant you can pop several option buttons on a form and create after update code for each of them to simulate the action of an option group. They are distinct controls, and so can be enabled\ disabled, but change values depending on the selections of the other option controls.

    As it happens, this is the way I created this affect before I realised there was an option group control.
    Yea i tried this on a continous form but still the same results but my client didn't mind because it changes depending on what record you are on.

Posting Permissions

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