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

Discussion in 'Access General' started by Hemil, Aug 10, 2004.

  1. Hemil

    Hemil Guest

    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.
     
    Hemil, Aug 10, 2004
    #1
    1. Advertising

  2. Hemil

    Ken Snell Guest

    How are you trying to set focus to that control? More details please.

    --

    Ken Snell
    <MS ACCESS MVP>

    "Hemil" <> wrote in message
    news:332901c47e90$f507b550$...
    > 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.
     
    Ken Snell, Aug 10, 2004
    #2
    1. Advertising

  3. Hemil

    Hemil Guest

    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" <> wrote in

    message
    >news:332901c47e90$f507b550$...
    >> 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.

    >
    >
    >.
    >
     
    Hemil, Aug 10, 2004
    #3
  4. Hemil

    Ken Snell Guest

    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" <> wrote in message
    news:381301c47f23$77b881e0$...
    > 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" <> wrote in

    > message
    > >news:332901c47e90$f507b550$...
    > >> 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.

    > >
    > >
    > >.
    > >
     
    Ken Snell, Aug 11, 2004
    #4
  5. Hemil

    Hemil Guest

    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" <> wrote in

    message
    >news:381301c47f23$77b881e0$...
    >> 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" <> wrote in

    >> message
    >> >news:332901c47e90$f507b550$...
    >> >> 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.
    >> >
    >> >
    >> >.
    >> >

    >
    >
    >.
    >
     
    Hemil, Aug 11, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RL

    Get Focus (Run-time error '2110')

    RL, Jun 9, 2009, in forum: Access Forms
    Replies:
    0
    Views:
    87
  2. NNLogistics

    Set focus Broke - Run-Time Error 2110

    NNLogistics, Mar 21, 2005, in forum: Access Forms Coding
    Replies:
    1
    Views:
    68
    Rick B
    Mar 21, 2005
  3. cyber
    Replies:
    5
    Views:
    149
  4. BruceM

    2110: Can't move the focus to subform control

    BruceM, May 14, 2007, in forum: Access Forms Coding
    Replies:
    3
    Views:
    75
    BruceM
    May 14, 2007
  5. JMay

    r/t 2110 - Can't Move Focus to control

    JMay, Nov 11, 2008, in forum: Excel Programming
    Replies:
    1
    Views:
    84
Loading...

Share This Page