Posts by atay

    Re: Set Focus To Application After Hiding UserForm


    Code
    DoCmd.OpenForm "UserForm1"


    return Runtime 424, object Required


    and

    Code
    Unload UserForm1


    works like "hide", when I'm press alt+space i have menu "move" and "close" from nowhere. When I click "close" focus is backing to application.

    Re: Setting Focus On Application After Userform.hide


    realy don't work :)


    how do I have ?
    I have hotkey button (CTRL+G) that running

    Code
    Public Sub PokazOkno()
    UserForm1.Show
    UserForm1.TextBox1.SetFocus
    End Sub


    even in form when i'm clicking X (windows close button) focus is stealed. I don't have any function assigned to "close window". I think .hide function don't kill window, just hiding it, but not with success (this window still exists and have focus), how to kill this window ?

    Re: Setting Focus On Application After Userform.hide


    doesn't work.
    The secound formula is only moving active cell, but it can't resolve focus to the application. Whole apllication lose focus and it looks like Excel is in background (and the other window before is active), but I hide this window (userform.hide) and it still have focus.

    I created UserForm with one TextBox and "Close" Button. And it's works like a real-time search with my criteria. He is using AutoFilter to show what he found. And when I'm pressing Close Button the Focus isn't on Application, but on Hidden window (know because when I'm clicking alt+space form's menu shows).


    To show window I'm using (running from hot-key):

    Code
    DoCmd.OpenForm "UserForm1"


    to hide

    Code
    Private Sub CloseButton_Click()
    UserForm1.Hide
    End Sub


    How to resolve focus on actual Worksheet ?