Results 1 to 3 of 3
  1. #1
    crimedog is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    141

    MInimize Application and set focus


    I have a Database that Opens to a Form.
    The On Open event has
    Code:
    DoCmd.RunCommand acCmdAppMinimize
    The form has 2 textboxes (For Authentication) I want TextBox TxtUsername to be the focus so user can just start typing.
    What currently happens: The Minimize command works - but the form is hidden behind whatever App the user has open (outlook IE etc...)
    If the user has anything open the form (Pop up & Modal) shows but it is not Active Or does not have the focus.
    I added :
    Code:
    Forms("0Frm_LogIn").SetFocus
    Me.TxtUserName.SetFocus
    In the Open Event - then moved it to the Load event (when that did not work)

    I have also tried to add a Splash form that has an On Open event to minimize Application and On timer event that Opens form 0Frm_Login - leaving the On Load events It works right if I am in Access. But if I start the Database directly it does not work.

    have a thread n the Access forum - prior to trying the Splash screen - and it is probably better in the Forms folder.

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,700
    I don't understand how the user can just start typing when the form is minimized.
    As far is being behind other open apps, if the form is minimized you can't see it even with NO other apps on the screen.

    That being said, if the form is not popup, you can use this in the form open event to set the focus:
    Code:
    Me.TxtUserName.SetFocus
    DoCmd.RunCommand acCmdAppMinimize
    The focus will be set to the login username if the user brings the form up visible from minimized.

  3. #3
    crimedog is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    141
    sorry about the long time - been away - the form is not minimized it is a pop up - the application is minimized so you can't see Access toolbars and window. Works great - but the form while not minimized will be behind anything else that is open

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2016, 10:59 AM
  2. Replies: 1
    Last Post: 08-27-2015, 06:05 AM
  3. Replies: 1
    Last Post: 02-21-2015, 11:35 PM
  4. Replies: 9
    Last Post: 10-20-2014, 08:43 PM
  5. Replies: 1
    Last Post: 12-05-2012, 07:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums