2110: Can't move the focus to subform control

  • Follow


In the After Update event of a combo box on the main form, I am attempting 
to move the focus to a subform, but I receive error 2110 telling me that I 
cannot do so.  I can click into the subform, so it doesn't seem to be an 
issue of its being locked or anything like that.  After much fruitless 
searching I am no closer to solving the problem.  I have tried setting the 
focus to a particular control on the subform, but that doesn't help.  Same 
with saving the record first, and every other suggestion I have been able to 
find.  Any ideas what could be causing this? 


0
Reply BruceM 5/14/2007 4:00:50 PM

When you need to set the focus to a control on a subform, you must first set 
the focus on the subform control (Border around the subform) and then set 
the focus on the control on the subform. It takes two lines of code:
Me!NameOfSubformControl.SetFocus
Me!NameOfSubformControl.Form!NameOfControlOnSubform.SetFocus

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com




"BruceM" <bamoob@yawhodawtcalm.not> wrote in message 
news:OZumMEklHHA.568@TK2MSFTNGP02.phx.gbl...
> In the After Update event of a combo box on the main form, I am attempting 
> to move the focus to a subform, but I receive error 2110 telling me that I 
> cannot do so.  I can click into the subform, so it doesn't seem to be an 
> issue of its being locked or anything like that.  After much fruitless 
> searching I am no closer to solving the problem.  I have tried setting the 
> focus to a particular control on the subform, but that doesn't help.  Same 
> with saving the record first, and every other suggestion I have been able 
> to find.  Any ideas what could be causing this?
> 


0
Reply Steve 5/14/2007 5:15:01 PM


Thanks for the reply.  I tried exactly that.  It's what I had intended to 
say when I wrote that I had tried setting the focus to a particular subform 
control.  I tried both with the bang and with the dot, and I tried 
Forms!frmName!SubformName.Form syntax, but always the same result:  Error 
2110.

"Steve" <sorry@private.emailaddress> wrote in message 
news:pO02i.9950$Ut6.6881@newsread1.news.pas.earthlink.net...
> When you need to set the focus to a control on a subform, you must first 
> set the focus on the subform control (Border around the subform) and then 
> set the focus on the control on the subform. It takes two lines of code:
> Me!NameOfSubformControl.SetFocus
> Me!NameOfSubformControl.Form!NameOfControlOnSubform.SetFocus
>
> PC Datasheet
> Providing Customers A Resource For Help With Access, Excel And Word
> Applications
> resource@pcdatasheet.com
>
>
>
>
> "BruceM" <bamoob@yawhodawtcalm.not> wrote in message 
> news:OZumMEklHHA.568@TK2MSFTNGP02.phx.gbl...
>> In the After Update event of a combo box on the main form, I am 
>> attempting to move the focus to a subform, but I receive error 2110 
>> telling me that I cannot do so.  I can click into the subform, so it 
>> doesn't seem to be an issue of its being locked or anything like that. 
>> After much fruitless searching I am no closer to solving the problem.  I 
>> have tried setting the focus to a particular control on the subform, but 
>> that doesn't help.  Same with saving the record first, and every other 
>> suggestion I have been able to find.  Any ideas what could be causing 
>> this?
>>
>
> 


0
Reply BruceM 5/14/2007 5:42:35 PM

As it happens, a compact and repair straightened out the whole thing.  I 
suspected something was wrong when I tried to save the record (Me.Dirty = 
False) without setting the focus, and the error message stating that I 
couldn't set the focus occurred anyhow.  I use detailed error handling, and 
the error message told me that I couldn't set the focus to the control | 
(that's the pipe character).  Also, the code broke on the Me.Dirty = False 
line.  As I said, I wasn't trying to set the focus at all, so I wondered if 
there was some phantom code.  That's when I decided to take a crack at 
Compact and Repair.
By the way, all I needed to do was set the focus to the subform control, not 
to a specific control on the subform.  Maybe that's because there is only 
one control on the subform that can receive the focus.

"BruceM" <bamoob@yawhodawtcalm.not> wrote in message 
news:e8izD9klHHA.1776@TK2MSFTNGP05.phx.gbl...
> Thanks for the reply.  I tried exactly that.  It's what I had intended to 
> say when I wrote that I had tried setting the focus to a particular 
> subform control.  I tried both with the bang and with the dot, and I tried 
> Forms!frmName!SubformName.Form syntax, but always the same result:  Error 
> 2110.
>
> "Steve" <sorry@private.emailaddress> wrote in message 
> news:pO02i.9950$Ut6.6881@newsread1.news.pas.earthlink.net...
>> When you need to set the focus to a control on a subform, you must first 
>> set the focus on the subform control (Border around the subform) and then 
>> set the focus on the control on the subform. It takes two lines of code:
>> Me!NameOfSubformControl.SetFocus
>> Me!NameOfSubformControl.Form!NameOfControlOnSubform.SetFocus
>>
>> PC Datasheet
>> Providing Customers A Resource For Help With Access, Excel And Word
>> Applications
>> resource@pcdatasheet.com
>>
>>
>>
>>
>> "BruceM" <bamoob@yawhodawtcalm.not> wrote in message 
>> news:OZumMEklHHA.568@TK2MSFTNGP02.phx.gbl...
>>> In the After Update event of a combo box on the main form, I am 
>>> attempting to move the focus to a subform, but I receive error 2110 
>>> telling me that I cannot do so.  I can click into the subform, so it 
>>> doesn't seem to be an issue of its being locked or anything like that. 
>>> After much fruitless searching I am no closer to solving the problem.  I 
>>> have tried setting the focus to a particular control on the subform, but 
>>> that doesn't help.  Same with saving the record first, and every other 
>>> suggestion I have been able to find.  Any ideas what could be causing 
>>> this?
>>>
>>
>>
>
> 


0
Reply BruceM 5/14/2007 7:20:05 PM

3 Replies
593 Views

(page loaded in 9.201 seconds)


Reply: