I coded a Access 2003 VBA program of our CE department. We have recently upgraded to Access 2007. They have a form to input a job order. On that form I used the "OnGotFocus" to put a certain color in the text field to show where they were on the form. Then when they tabbed to the next field I used the "OnLost Focus" to set the BackColor to the orginal color. When we upgraded to Access 2007 the program worked fine except for the COMBO Boxes. when the user Tabs out of the field and "OnLostFocus" is used the BackColor does not revert to the orginal color in the COMBO Boxes only. What Gives?
GeoffS Level: VB Lord Registered: 29-09-2004 Posts: 541
Re: Access 2007 VBA
This is just a guess, but as you have not got an answer to this one yet I thought it might be worth a try.
I have found in the past that sometimes Access will not let you change a control's property from code if the control does not have the Focus. Try getting the CurrentControl into a variable, putting focus back to the Combo control, change the BackColor, then return focus to the new control via the variable.
____________________________ multi-tasking - the ability to hang more than one app. at the same time.