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. Advertisements

  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. Advertisements

  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. Advertisements

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. Brandon
    Replies:
    7
    Views:
    161
    Brandon
    Jul 17, 2004
  2. okesedad

    Access 2002 Run-Time error 2110

    okesedad, Jan 17, 2005, in forum: Access General
    Replies:
    2
    Views:
    240
    okesedad
    Jan 18, 2005
  3. Michel S.
    Replies:
    0
    Views:
    119
    Michel S.
    Aug 24, 2006
  4. Stapes
    Replies:
    2
    Views:
    118
    Nicholas Scarpinato
    Feb 21, 2008
  5. IanC

    Can't move the focus to the control

    IanC, Jan 5, 2009, in forum: Access General
    Replies:
    1
    Views:
    449
    Dale Fye
    Jan 5, 2009
  6. IanC

    Can't move the focus to the control

    IanC, Jan 5, 2009, in forum: Access General
    Replies:
    0
    Views:
    110
  7. IanC
    Replies:
    4
    Views:
    152
  8. tkosel

    Can't Move Focus Problem

    tkosel, Feb 26, 2010, in forum: Access General
    Replies:
    1
    Views:
    110
    Ken Snell
    Feb 26, 2010
Loading...