Microsoft Office Forums


Reply
Thread Tools Display Modes

Run-time error '2110': Microsoft Access can't move the focus to the control

 
 
Hemil
Guest
Posts: n/a
 
      08-10-2004, 04:17 AM
Hello Friends,

I am facing a strange problem with my access application
code. I get the following error message when I try to set
focus to a dropdown control on my multitabbed access form.
Run-time error '2110':
Microsoft Access can't move the focus to the
control 'ControlName'

I have set the dropdown control's visible and enabled
property to true before setting focus.

Please help. Any suggestions welcome.

Regards.
 
Reply With Quote
 
 
 
 
Ken Snell
Guest
Posts: n/a
 
      08-10-2004, 12:40 PM
How are you trying to set focus to that control? More details please.

--

Ken Snell
<MS ACCESS MVP>

"Hemil" <(E-Mail Removed)> wrote in message
news:332901c47e90$f507b550$(E-Mail Removed)...
> Hello Friends,
>
> I am facing a strange problem with my access application
> code. I get the following error message when I try to set
> focus to a dropdown control on my multitabbed access form.
> Run-time error '2110':
> Microsoft Access can't move the focus to the
> control 'ControlName'
>
> I have set the dropdown control's visible and enabled
> property to true before setting focus.
>
> Please help. Any suggestions welcome.
>
> Regards.



 
Reply With Quote
 
 
 
 
Hemil
Guest
Posts: n/a
 
      08-10-2004, 09:46 PM
Hi Ken,

Thanks for your response.
Following is my code: [EnforcementOption] is the dropdown
box to which I need to set focus.

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "You must enter an Enforcement Option!"
bFormHasError = False
If IsNull(Me![EnforcementOption]) Then
MsgBox strMsg
Cancel = True
bFormHasError = True
Me![EnforcementOption].Visible = True
Me![EnforcementOption].Enabled = True
Me![EnforcementOption].SetFocus
Exit Sub
ElseIf (Len(Me![EnforcementOption]) = 0) Then
MsgBox strMsg
Cancel = True
bFormHasError = True
Me![EnforcementOption].Visible = True
Me![EnforcementOption].Enabled = True
Me![EnforcementOption].SetFocus
Exit Sub
End If
End Sub

Do let me know if you need any further information.


Thanks & Regards,

Hemil.



>-----Original Message-----
>How are you trying to set focus to that control? More

details please.
>
>--
>
> Ken Snell
><MS ACCESS MVP>
>
>"Hemil" <(E-Mail Removed)> wrote in

message
>news:332901c47e90$f507b550$(E-Mail Removed)...
>> Hello Friends,
>>
>> I am facing a strange problem with my access application
>> code. I get the following error message when I try to

set
>> focus to a dropdown control on my multitabbed access

form.
>> Run-time error '2110':
>> Microsoft Access can't move the focus to the
>> control 'ControlName'
>>
>> I have set the dropdown control's visible and enabled
>> property to true before setting focus.
>>
>> Please help. Any suggestions welcome.
>>
>> Regards.

>
>
>.
>

 
Reply With Quote
 
Ken Snell
Guest
Posts: n/a
 
      08-10-2004, 11:37 PM
Is EnforcementOption the name of a control on the form? And is
EnforcementOption bound to a field that also is named EnforcementOption? If
yes, my guess is that ACCESS thinks you want to set focus on the field, and
not on the control.

Change the control name to txtEnforcementOption and change the code
accordingly.

--

Ken Snell
<MS ACCESS MVP>

"Hemil" <(E-Mail Removed)> wrote in message
news:381301c47f23$77b881e0$(E-Mail Removed)...
> Hi Ken,
>
> Thanks for your response.
> Following is my code: [EnforcementOption] is the dropdown
> box to which I need to set focus.
>
> Private Sub Form_BeforeUpdate(Cancel As Integer)
> Dim strMsg As String
> strMsg = "You must enter an Enforcement Option!"
> bFormHasError = False
> If IsNull(Me![EnforcementOption]) Then
> MsgBox strMsg
> Cancel = True
> bFormHasError = True
> Me![EnforcementOption].Visible = True
> Me![EnforcementOption].Enabled = True
> Me![EnforcementOption].SetFocus
> Exit Sub
> ElseIf (Len(Me![EnforcementOption]) = 0) Then
> MsgBox strMsg
> Cancel = True
> bFormHasError = True
> Me![EnforcementOption].Visible = True
> Me![EnforcementOption].Enabled = True
> Me![EnforcementOption].SetFocus
> Exit Sub
> End If
> End Sub
>
> Do let me know if you need any further information.
>
>
> Thanks & Regards,
>
> Hemil.
>
>
>
> >-----Original Message-----
> >How are you trying to set focus to that control? More

> details please.
> >
> >--
> >
> > Ken Snell
> ><MS ACCESS MVP>
> >
> >"Hemil" <(E-Mail Removed)> wrote in

> message
> >news:332901c47e90$f507b550$(E-Mail Removed)...
> >> Hello Friends,
> >>
> >> I am facing a strange problem with my access application
> >> code. I get the following error message when I try to

> set
> >> focus to a dropdown control on my multitabbed access

> form.
> >> Run-time error '2110':
> >> Microsoft Access can't move the focus to the
> >> control 'ControlName'
> >>
> >> I have set the dropdown control's visible and enabled
> >> property to true before setting focus.
> >>
> >> Please help. Any suggestions welcome.
> >>
> >> Regards.

> >
> >
> >.
> >



 
Reply With Quote
 
Hemil
Guest
Posts: n/a
 
      08-11-2004, 05:25 AM
Thanks a lot Ken,

You gave me the right direction.

Regards,
Hemil.
>-----Original Message-----
>Is EnforcementOption the name of a control on the form?

And is
>EnforcementOption bound to a field that also is named

EnforcementOption? If
>yes, my guess is that ACCESS thinks you want to set focus

on the field, and
>not on the control.
>
>Change the control name to txtEnforcementOption and

change the code
>accordingly.
>
>--
>
> Ken Snell
><MS ACCESS MVP>
>
>"Hemil" <(E-Mail Removed)> wrote in

message
>news:381301c47f23$77b881e0$(E-Mail Removed)...
>> Hi Ken,
>>
>> Thanks for your response.
>> Following is my code: [EnforcementOption] is the

dropdown
>> box to which I need to set focus.
>>
>> Private Sub Form_BeforeUpdate(Cancel As Integer)
>> Dim strMsg As String
>> strMsg = "You must enter an Enforcement Option!"
>> bFormHasError = False
>> If IsNull(Me![EnforcementOption]) Then
>> MsgBox strMsg
>> Cancel = True
>> bFormHasError = True
>> Me![EnforcementOption].Visible = True
>> Me![EnforcementOption].Enabled = True
>> Me![EnforcementOption].SetFocus
>> Exit Sub
>> ElseIf (Len(Me![EnforcementOption]) = 0) Then
>> MsgBox strMsg
>> Cancel = True
>> bFormHasError = True
>> Me![EnforcementOption].Visible = True
>> Me![EnforcementOption].Enabled = True
>> Me![EnforcementOption].SetFocus
>> Exit Sub
>> End If
>> End Sub
>>
>> Do let me know if you need any further information.
>>
>>
>> Thanks & Regards,
>>
>> Hemil.
>>
>>
>>
>> >-----Original Message-----
>> >How are you trying to set focus to that control? More

>> details please.
>> >
>> >--
>> >
>> > Ken Snell
>> ><MS ACCESS MVP>
>> >
>> >"Hemil" <(E-Mail Removed)> wrote in

>> message
>> >news:332901c47e90$f507b550$(E-Mail Removed)...
>> >> Hello Friends,
>> >>
>> >> I am facing a strange problem with my access

application
>> >> code. I get the following error message when I try

to
>> set
>> >> focus to a dropdown control on my multitabbed access

>> form.
>> >> Run-time error '2110':
>> >> Microsoft Access can't move the focus to the
>> >> control 'ControlName'
>> >>
>> >> I have set the dropdown control's visible and enabled
>> >> property to true before setting focus.
>> >>
>> >> Please help. Any suggestions welcome.
>> >>
>> >> Regards.
>> >
>> >
>> >.
>> >

>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"can't move the focus to the control Picture" error PaulHollingshead via AccessMonster.com Access Configuration 1 05-04-2011 04:22 PM
Can't move the focus to the control IanC Access General 1 01-05-2009 05:52 PM
Form focus will not move from control to control Mike in Colorado Access Forms Coding 0 12-03-2007 06:28 AM
"Runtime Error 2110" cannot move the focus to the control cyber Access Forms Coding 5 07-20-2005 08:33 PM
How can I move the focus to a control on a subform? Brandon Access General 7 07-17-2004 12:39 AM


All times are GMT. The time now is 10:04 PM.
Microsoft Office Forums is not affiliated with Microsoft Corporation.


Welcome!
Welcome to the Microsoft Office Forums
 


Latest Threads
New user looking for shapes/templates
SargeUSMC (04-21-2014, 04:23 PM)

Mail Merging Content With High Quality
oleander (04-17-2014, 11:59 PM)

Aargh. What is this?
PeteJ (04-17-2014, 12:10 PM)

Word 2013 Insert Symbol (Not Responding)
tpthrshr (04-17-2014, 02:49 AM)

Can't save a large Word document
Josh (04-17-2014, 01:03 AM)