Button highlight

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jaad
    New Member
    • Oct 2009
    • 158

    Button highlight

    Hey guy,

    I have a series of buttons that I use to set filters on a schedule form: Past, Today, tomorrow, This Week, This month and All.

    I don't have problem with the filters, it's the button itself that gives me trouble. When I press the button in the best of time it becomes highlighted signifying that this is the last button I pressed.

    Funny thing is when I press let's say Tomorrow button, the Today button get highlighted, but it doesn't affect the filter, I wonder why that is?

    I use access 2007 with the preset theme Office for my form.
    I have copied and pasted all my buttons from the same one and changed the name and code for each and they all work fine. It just bug me that the highlight feature of the button doesn't highlight the right button when it is pressed.

    Any ideas?
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Guess you use a SetFocus command referring to the wrong button name.
    But would be better to have the code to see what happens.

    Nic;o)

    Comment

    • jaad
      New Member
      • Oct 2009
      • 158

      #3
      No it set on Click.
      Code:
      Private Sub FilterTodayCmd_Click()
          Me.Filter = "(Year(ProjectScheduleT.DateStart)=Year(Date()) And Month(ProjectScheduleT.DateStart)=Month(Date()) And Day(ProjectScheduleT.DateStart)=Day(Date()))"
          Me.FilterOn = True
          
      End Sub
      This is an example of the filter codes all set on Click event.

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Hmm, that doesn't cause the effect.
        Can you attach a zipped .mdb with a sample form with the buttons showing this behavior ?

        Nic;o)

        Comment

        • jaad
          New Member
          • Oct 2009
          • 158

          #5
          I figured it out...
          I added a line at the end of my code
          Code:
          FilterTodayCmd.SetFocus

          Comment

          Working...