You can't hide a control that has the focus

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon

    You can't hide a control that has the focus

    Dear reader,



    On the event "Lost focus" I make the ComboBox invisible but the massage pops
    up

    "You can't hide a control that has the focus." But this code is written in
    the "Lost focus" event so the combobox has not longer the focus regarding
    this event.

    And if I set the focus to an other control, the code Me.ComboBox.Vis ible =
    False

    delivers still the massage: "You can't hide a control that has the focus."

    The question is now:

    How to move the focus from the ComboBox and hide the ComboBox.



    Tanks for any help.

    Kind regards,

    Simon



  • Arno R

    #2
    Re: You can't hide a control that has the focus


    "Simon" <SvanBeekNL@Ver satel.nlschreef in bericht news:482f4007$0 $28358$bf4948fe @news.tele2.nl. ..
    On the event "Lost focus" I make the ComboBox invisible but the massage pops
    up

    "You can't hide a control that has the focus." But this code is written in
    the "Lost focus" event so the combobox has not longer the focus regarding
    this event.
    So don't use that event for this action. . .

    And if I set the focus to an other control, the code Me.ComboBox.Vis ible =
    False

    delivers still the massage: "You can't hide a control that has the focus."

    The question is now:

    How to move the focus from the ComboBox and hide the ComboBox.
    Oh please. . .
    FIRST set focus to another control,
    THEN make your combo invisible. . .

    Arno R

    Comment

    • Simon

      #3
      Re: You can't hide a control that has the focus

      I tried every think to move the focus from the combox but nothing works.



      Me.Repaint

      Me.OtherComboBo x.SetFocus

      DoCmd.GoToContr ol "OtherCombo Box"



      But still the message appears:

      "You can't hide a control that has the focus."



      The question is how to remove the focus from the combobox?



      Regards,

      Simon


      "Arno R" <arracomn_o_s_p _a_m@planet.nls chreef in bericht
      news:482f64de$0 $6014$ba620dc5@ text.nova.plane t.nl...

      "Simon" <SvanBeekNL@Ver satel.nlschreef in bericht
      news:482f4007$0 $28358$bf4948fe @news.tele2.nl. ..
      On the event "Lost focus" I make the ComboBox invisible but the massage
      pops
      up
      >
      "You can't hide a control that has the focus." But this code is written
      in
      the "Lost focus" event so the combobox has not longer the focus
      regarding
      this event.
      So don't use that event for this action. . .

      And if I set the focus to an other control, the code
      Me.ComboBox.Vis ible =
      False
      >
      delivers still the massage: "You can't hide a control that has the
      focus."
      >
      The question is now:
      >
      How to move the focus from the ComboBox and hide the ComboBox.
      >
      Oh please. . .
      FIRST set focus to another control,
      THEN make your combo invisible. . .

      Arno R



      Comment

      • Rick Brandt

        #4
        Re: You can't hide a control that has the focus

        Simon wrote:
        I tried every think to move the focus from the combox but nothing
        works.
        It is not the code you are using. This should work fine...

        Me.SomeOtherCon trolName.SetFoc us
        Me.ComboBoxName .Visible = False

        It is the event you are using. Some control events cannot be used to set
        focus to another control. You just need to use a different event.

        --
        Rick Brandt, Microsoft Access MVP
        Email (as appropriate) to...
        RBrandt at Hunter dot com


        Comment

        Working...