Rocky Smolin
rockysmolin at bchacc.com
Wed Dec 26 10:22:54 CST 2012
Dear List: I am getting an error 2110: can't move the focus to the control... It occurs in this code: Private Sub imgGraphicForTimeEntryNarrative_Click() Me.imgGraphicForTimeEntryNarrative.Visible = False Me.TimeEntryNarrative.SetFocus End Sub in the SetFocus line. After I get the error, if I press F5 the program carries on normally setting the focus to TimeEntryNarrative. However, there is a condition that causes this. Mostly clicking into imgGraphicForTimeEntryNarrative (which is a graphic OVER a text box. The graphic shows if there's nothing in the text box and is made invisible when there is something in the text box), works fine. But if the user clicks into one of two other text boxes and then clicks imgGraphicForTimeEntryNarrative, the error occurs. Both those boxes have a LostFocus event as follows: Private Sub txtEditWorkedTime_LostFocus() Me.cmdExit.SetFocus Me.txtEditWorkedTime.Visible = False Me.HoursBillable.SetFocus End Sub If I temporarily disable that module: Private Sub txtEditWorkedTime_LostFocus() Exit Sub Me.cmdExit.SetFocus Me.txtEditWorkedTime.Visible = False Me.HoursBillable.SetFocus End Sub then Private Sub imgGraphicForTimeEntryNarrative_Click() works. I'm not opposed to a quick fix or workaround for this. But I have gotten this error before - does anyone know the general cause (or general solution)? Odd that after I get the error I can resume code execution and it works! MTIA Rocky Smolin Beach Access Software 858-259-4334 www.bchacc.com <http://www.bchacc.com/> www.e-z-mrp.com <http://www.e-z-mrp.com/> Skype: rocky.smolin