+ Reply to Thread
Results 1 to 4 of 4

Userform Focus

  1. #1
    David Coleman
    Guest

    Userform Focus

    Hi

    I've got a userform (called stagedetails) with a combobox (called combobox3)
    that should always be the active control when the form is shown.

    It works perfectly the first time but once a button on the form has been
    clicked I can't change the focus back.

    The form can be seen at www.thestormdragon.com The default button is "Save
    and Return".

    I've tried unloading and reloading / hiding and showing but it makes no
    difference and the vba code of

    stagedetails.combobox3.setfocus

    doesn't work.

    I've searched through this group and the google group archives without
    success. Any ideas?

    Many thanks

    David



  2. #2
    Chip Pearson
    Guest

    Re: Userform Focus

    Use

    Private Sub UserForm_Initialize()
    Me.ComboBox3.SetFocus
    End Sub


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "David Coleman" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    >
    > I've got a userform (called stagedetails) with a combobox
    > (called combobox3) that should always be the active control
    > when the form is shown.
    >
    > It works perfectly the first time but once a button on the form
    > has been clicked I can't change the focus back.
    >
    > The form can be seen at www.thestormdragon.com The default
    > button is "Save and Return".
    >
    > I've tried unloading and reloading / hiding and showing but it
    > makes no difference and the vba code of
    >
    > stagedetails.combobox3.setfocus
    >
    > doesn't work.
    >
    > I've searched through this group and the google group archives
    > without success. Any ideas?
    >
    > Many thanks
    >
    > David
    >




  3. #3
    David Coleman
    Guest

    Re: Userform Focus

    Hi Chip

    I've just tried that and it makes no difference.

    Is there anyway of tracking what it's doing / finding out why it's failing?

    Thanks

    David

    "Chip Pearson" <[email protected]> wrote in message
    news:[email protected]...
    > Use
    >
    > Private Sub UserForm_Initialize()
    > Me.ComboBox3.SetFocus
    > End Sub
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    > "David Coleman" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi
    >>
    >> I've got a userform (called stagedetails) with a combobox (called
    >> combobox3) that should always be the active control when the form is
    >> shown.
    >>
    >> It works perfectly the first time but once a button on the form has been
    >> clicked I can't change the focus back.
    >>
    >> The form can be seen at www.thestormdragon.com The default button is
    >> "Save and Return".
    >>
    >> I've tried unloading and reloading / hiding and showing but it makes no
    >> difference and the vba code of
    >>
    >> stagedetails.combobox3.setfocus
    >>
    >> doesn't work.
    >>
    >> I've searched through this group and the google group archives without
    >> success. Any ideas?
    >>
    >> Many thanks
    >>
    >> David
    >>

    >
    >




  4. #4
    David Coleman
    Guest

    Re: Userform Focus

    With userform_activate() , rather than userform_initialize, it
    works perfectly.

    Thanks

    David


    "David Coleman" <[email protected]> wrote in message
    news:u1xE%[email protected]...
    > Hi Chip
    >
    > I've just tried that and it makes no difference.
    >
    > Is there anyway of tracking what it's doing / finding out why it's
    > failing?
    >
    > Thanks
    >
    > David
    >
    > "Chip Pearson" <[email protected]> wrote in message
    > news:[email protected]...
    >> Use
    >>
    >> Private Sub UserForm_Initialize()
    >> Me.ComboBox3.SetFocus
    >> End Sub
    >>
    >>
    >> --
    >> Cordially,
    >> Chip Pearson
    >> Microsoft MVP - Excel
    >> Pearson Software Consulting, LLC
    >> www.cpearson.com
    >>
    >>
    >> "David Coleman" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi
    >>>
    >>> I've got a userform (called stagedetails) with a combobox (called
    >>> combobox3) that should always be the active control when the form is
    >>> shown.
    >>>
    >>> It works perfectly the first time but once a button on the form has been
    >>> clicked I can't change the focus back.
    >>>
    >>> The form can be seen at www.thestormdragon.com The default button is
    >>> "Save and Return".
    >>>
    >>> I've tried unloading and reloading / hiding and showing but it makes no
    >>> difference and the vba code of
    >>>
    >>> stagedetails.combobox3.setfocus
    >>>
    >>> doesn't work.
    >>>
    >>> I've searched through this group and the google group archives without
    >>> success. Any ideas?
    >>>
    >>> Many thanks
    >>>
    >>> David
    >>>

    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1