Connect with Expertise | Find Experts, Get Answers, Share Insights

Button highlight

C
 
Join Date: Oct 2009
Posts: 108
#1: Feb 9 '10
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's Avatar
E
M
C
 
Join Date: Nov 2006
Location: The Netherlands
Posts: 2,655
#2: Feb 9 '10

re: Button highlight


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)
C
 
Join Date: Oct 2009
Posts: 108
#3: Feb 9 '10

re: Button highlight


No it set on Click.
Expand|Select|Wrap|Line Numbers
  1. Private Sub FilterTodayCmd_Click()
  2.     Me.Filter = "(Year(ProjectScheduleT.DateStart)=Year(Date()) And Month(ProjectScheduleT.DateStart)=Month(Date()) And Day(ProjectScheduleT.DateStart)=Day(Date()))"
  3.     Me.FilterOn = True
  4.  
  5. End Sub
This is an example of the filter codes all set on Click event.
nico5038's Avatar
E
M
C
 
Join Date: Nov 2006
Location: The Netherlands
Posts: 2,655
#4: Feb 9 '10

re: Button highlight


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)
C
 
Join Date: Oct 2009
Posts: 108
#5: Feb 9 '10

re: Button highlight


I figured it out...
I added a line at the end of my code
Expand|Select|Wrap|Line Numbers
  1. FilterTodayCmd.SetFocus
Reply